/*
 RequireJS domReady 2.0.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/domReady for details

 lodash 4.5.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
 Build: `lodash -o ./dist/lodash.js`
 MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors  MIT License (c) copyright 2010-2014 original author or authors */
define("third_party/domready/domReady",[],function(){function c(){if(!n){n=!0;a&&clearInterval(a);var c=h;if(n&&c.length){h=[];var e;for(e=0;e<c.length;e+=1)c[e](v)}}}function k(a){n?a(v):h.push(a);return k}var l,f,a,e="undefined"!==typeof window&&window.document,n=!e,v=e?document:null,h=[];if(e){if(document.addEventListener)document.addEventListener("DOMContentLoaded",c,!1),window.addEventListener("load",c,!1);else if(window.attachEvent){window.attachEvent("onload",c);f=document.createElement("div");
try{l=null===window.frameElement}catch(p){}f.doScroll&&l&&window.external&&(a=setInterval(function(){try{f.doScroll(),c()}catch(a){}},30))}"complete"===document.readyState&&c()}k.version="2.0.1";k.load=function(a,c,e,h){h.isBuild?e(null):k(e)};return k});
(function(){function c(c){var l=null;if(this.id===c)return this;if(this.hasChildNodes())for(var f=0,a=this.childNodes.length;f<a&&(this.childNodes[f].nodeType!==Node.ELEMENT_NODE||!(l=this.childNodes[f].getElementById(c))||l.id!==c);f++);return l}Element.prototype.clear=function(){if(this.hasChildNodes())for(;1<=this.childNodes.length;)this.removeChild(this.firstChild);return this};Element.prototype.removeElm=function(){return this.parentNode?(this.parentNode.removeChild(this),this):null};Function.prototype.bake=
function(c){var l=this,f=[].slice.call(arguments,1);return function(){return l.apply(c,f.concat([].slice.call(arguments,0)))}};Element.prototype.getElementById=c;DocumentFragment.prototype.getElementById=c})();define("qowtRoot/lib/framework/framework",function(){});
(function(){var c,k=k||{},l=this,f=function(b){return void 0!==b},a=function(){},e=function(b){var m=typeof b;if("object"==m)if(b){if(b instanceof Array)return"array";if(b instanceof Object)return m;var w=Object.prototype.toString.call(b);if("[object Window]"==w)return"object";if("[object Array]"==w||"number"==typeof b.length&&"undefined"!=typeof b.splice&&"undefined"!=typeof b.propertyIsEnumerable&&!b.propertyIsEnumerable("splice"))return"array";if("[object Function]"==w||"undefined"!=typeof b.call&&
"undefined"!=typeof b.propertyIsEnumerable&&!b.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==m&&"undefined"==typeof b.call)return"object";return m},n=function(b){return"array"==e(b)},v=function(b){var m=e(b);return"array"==m||"object"==m&&"number"==typeof b.length},h=function(b){return"string"==typeof b},p=function(b){return"number"==typeof b},y=function(b){return"function"==e(b)},x=function(b){var m=typeof b;return"object"==m&&null!=b||"function"==m},N=function(b,
m,w){return b.call.apply(b.bind,arguments)},G=function(b,m,w){if(!b)throw Error();if(2<arguments.length){var a=Array.prototype.slice.call(arguments,2);return function(){var w=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(w,a);return b.apply(m,w)}}return function(){return b.apply(m,arguments)}},z=function(b,m,w){z=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?N:G;return z.apply(null,arguments)},A=function(b,m){var w=Array.prototype.slice.call(arguments,
1);return function(){var m=w.slice();m.push.apply(m,arguments);return b.apply(this,m)}},E=Date.now||function(){return+new Date},r=function(b,m){var w=b.split("."),a=l;w[0]in a||!a.execScript||a.execScript("var "+w[0]);for(var d;w.length&&(d=w.shift());)!w.length&&f(m)?a[d]=m:a=a[d]?a[d]:a[d]={}},H=function(b,m){function w(){}w.prototype=m.prototype;b.K=m.prototype;b.prototype=new w;b.Qc=function(b,w,a){return m.prototype[w].apply(b,Array.prototype.slice.call(arguments,2))}};Function.prototype.bind=
Function.prototype.bind||function(b,m){if(1<arguments.length){var w=Array.prototype.slice.call(arguments,1);w.unshift(this,b);return z.apply(null,w)}return z(this,b)};var Q=function(b){if(Error.captureStackTrace)Error.captureStackTrace(this,Q);else{var m=Error().stack;m&&(this.stack=m)}b&&(this.message=String(b))};H(Q,Error);Q.prototype.name="CustomError";var ca=String.prototype.trim?function(b){return b.trim()}:function(b){return b.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},da=function(b,m){return b<
m?-1:b>m?1:0},F=Array.prototype,ta=F.indexOf?function(b,m,w){return F.indexOf.call(b,m,w)}:function(b,m,w){w=null==w?0:0>w?Math.max(0,b.length+w):w;if(h(b))return h(m)&&1==m.length?b.indexOf(m,w):-1;for(;w<b.length;w++)if(w in b&&b[w]===m)return w;return-1},t=F.forEach?function(b,m,w){F.forEach.call(b,m,w)}:function(b,m,w){for(var a=b.length,d=h(b)?b.split(""):b,c=0;c<a;c++)c in d&&m.call(w,d[c],c,b)},U=F.some?function(b,m,w){return F.some.call(b,m,w)}:function(b,m,w){for(var a=b.length,d=h(b)?b.split(""):
b,c=0;c<a;c++)if(c in d&&m.call(w,d[c],c,b))return!0;return!1},S=F.every?function(b,m,w){return F.every.call(b,m,w)}:function(b,m,w){for(var a=b.length,d=h(b)?b.split(""):b,c=0;c<a;c++)if(c in d&&!m.call(w,d[c],c,b))return!1;return!0},J=function(b){var m;a:{m=Pd;for(var w=b.length,a=h(b)?b.split(""):b,d=0;d<w;d++)if(d in a&&m.call(void 0,a[d],d,b)){m=d;break a}m=-1}return 0>m?null:h(b)?b.charAt(m):b[m]},cc=function(b,m){var w=ta(b,m),a;(a=0<=w)&&F.splice.call(b,w,1);return a},wb=function(b){return F.concat.apply(F,
arguments)},ed=function(b,m,w){return 2>=arguments.length?F.slice.call(b,m):F.slice.call(b,m,w)},dc="StopIteration"in l?l.StopIteration:Error("StopIteration"),Lb=function(){};Lb.prototype.next=function(){throw dc;};Lb.prototype.wc=function(){return this};var $a=function(b,m,w){for(var a in b)m.call(w,b[a],a,b)},Ca=function(b){var m=[],w=0,a;for(a in b)m[w++]=b[a];return m},xb=function(b){var m=[],w=0,a;for(a in b)m[w++]=a;return m},ec=function(b,m){var w;a:{for(w in b)if(m.call(void 0,b[w],w,b))break a;
w=void 0}return w&&b[w]},Da="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Mb=function(b,m){for(var w,a,d=1;d<arguments.length;d++){a=arguments[d];for(w in a)b[w]=a[w];for(var c=0;c<Da.length;c++)w=Da[c],Object.prototype.hasOwnProperty.call(a,w)&&(b[w]=a[w])}},ea=function(b,m){this.q={};this.b=[];this.ra=this.j=0;var w=arguments.length;if(1<w){if(w%2)throw Error("Uneven number of arguments");for(var a=0;a<w;a+=2)this.set(arguments[a],arguments[a+
1])}else b&&this.la(b)};ea.prototype.w=function(){yb(this);for(var b=[],m=0;m<this.b.length;m++)b.push(this.q[this.b[m]]);return b};ea.prototype.H=function(){yb(this);return this.b.concat()};ea.prototype.R=function(b){return ab(this.q,b)};ea.prototype.remove=function(b){return ab(this.q,b)?(delete this.q[b],this.j--,this.ra++,this.b.length>2*this.j&&yb(this),!0):!1};var yb=function(b){if(b.j!=b.b.length){for(var m=0,w=0;m<b.b.length;){var a=b.b[m];ab(b.q,a)&&(b.b[w++]=a);m++}b.b.length=w}if(b.j!=
b.b.length){for(var d={},w=m=0;m<b.b.length;)a=b.b[m],ab(d,a)||(b.b[w++]=a,d[a]=1),m++;b.b.length=w}};c=ea.prototype;c.get=function(b,m){return ab(this.q,b)?this.q[b]:m};c.set=function(b,m){ab(this.q,b)||(this.j++,this.b.push(b),this.ra++);this.q[b]=m};c.la=function(b){var m;b instanceof ea?(m=b.H(),b=b.w()):(m=xb(b),b=Ca(b));for(var a=0;a<m.length;a++)this.set(m[a],b[a])};c.forEach=function(b,m){for(var a=this.H(),d=0;d<a.length;d++){var c=a[d],e=this.get(c);b.call(m,e,c,this)}};c.clone=function(){return new ea(this)};
c.Lb=function(){yb(this);for(var b={},m=0;m<this.b.length;m++){var a=this.b[m];b[a]=this.q[a]}return b};c.wc=function(b){yb(this);var m=0,a=this.b,d=this.q,c=this.ra,e=this,h=new Lb;h.next=function(){for(;;){if(c!=e.ra)throw Error("The map has changed since the iterator was created");if(m>=a.length)throw dc;var h=a[m++];return b?h:d[h]}};return h};var ab=function(b,m){return Object.prototype.hasOwnProperty.call(b,m)},q,jb,Cc={id:"hitType",name:"t",valueType:"text",maxLength:void 0,defaultValue:void 0},
zb={id:"sessionControl",name:"sc",valueType:"text",maxLength:void 0,defaultValue:void 0},Dc={id:"description",name:"cd",valueType:"text",maxLength:2048,defaultValue:void 0},fc={id:"eventCategory",name:"ec",valueType:"text",maxLength:150,defaultValue:void 0},gc={id:"eventAction",name:"ea",valueType:"text",maxLength:500,defaultValue:void 0},kb={id:"eventLabel",name:"el",valueType:"text",maxLength:500,defaultValue:void 0},Ab={id:"eventValue",name:"ev",valueType:"integer",maxLength:void 0,defaultValue:void 0},
Ec={qd:Cc,Rc:{id:"anonymizeIp",name:"aip",valueType:"boolean",maxLength:void 0,defaultValue:void 0},Bd:{id:"queueTime",name:"qt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Xc:{id:"cacheBuster",name:"z",valueType:"text",maxLength:void 0,defaultValue:void 0},Hd:zb,Id:{id:"sessionGroup",name:"sg",valueType:"text",maxLength:void 0,defaultValue:void 0},Yd:{id:"userId",name:"uid",valueType:"text",maxLength:void 0,defaultValue:void 0},yd:{id:"nonInteraction",name:"ni",valueType:"boolean",
maxLength:void 0,defaultValue:void 0},gd:Dc,Rd:{id:"title",name:"dt",valueType:"text",maxLength:1500,defaultValue:void 0},Tc:{id:"appId",name:"aid",valueType:"text",maxLength:150,defaultValue:void 0},Uc:{id:"appInstallerId",name:"aiid",valueType:"text",maxLength:150,defaultValue:void 0},kd:fc,jd:gc,ld:kb,md:Ab,Kd:{id:"socialNetwork",name:"sn",valueType:"text",maxLength:50,defaultValue:void 0},Jd:{id:"socialAction",name:"sa",valueType:"text",maxLength:50,defaultValue:void 0},Ld:{id:"socialTarget",
name:"st",valueType:"text",maxLength:2048,defaultValue:void 0},Ud:{id:"transactionId",name:"ti",valueType:"text",maxLength:500,defaultValue:void 0},Td:{id:"transactionAffiliation",name:"ta",valueType:"text",maxLength:500,defaultValue:void 0},Vd:{id:"transactionRevenue",name:"tr",valueType:"currency",maxLength:void 0,defaultValue:void 0},Wd:{id:"transactionShipping",name:"ts",valueType:"currency",maxLength:void 0,defaultValue:void 0},Xd:{id:"transactionTax",name:"tt",valueType:"currency",maxLength:void 0,
defaultValue:void 0},ed:{id:"currencyCode",name:"cu",valueType:"text",maxLength:10,defaultValue:void 0},ud:{id:"itemPrice",name:"ip",valueType:"currency",maxLength:void 0,defaultValue:void 0},vd:{id:"itemQuantity",name:"iq",valueType:"integer",maxLength:void 0,defaultValue:void 0},sd:{id:"itemCode",name:"ic",valueType:"text",maxLength:500,defaultValue:void 0},td:{id:"itemName",name:"in",valueType:"text",maxLength:500,defaultValue:void 0},rd:{id:"itemCategory",name:"iv",valueType:"text",maxLength:500,
defaultValue:void 0},cd:{id:"campaignSource",name:"cs",valueType:"text",maxLength:100,defaultValue:void 0},ad:{id:"campaignMedium",name:"cm",valueType:"text",maxLength:50,defaultValue:void 0},bd:{id:"campaignName",name:"cn",valueType:"text",maxLength:100,defaultValue:void 0},$c:{id:"campaignKeyword",name:"ck",valueType:"text",maxLength:500,defaultValue:void 0},Yc:{id:"campaignContent",name:"cc",valueType:"text",maxLength:500,defaultValue:void 0},Zc:{id:"campaignId",name:"ci",valueType:"text",maxLength:100,
defaultValue:void 0},pd:{id:"gclid",name:"gclid",valueType:"text",maxLength:void 0,defaultValue:void 0},fd:{id:"dclid",name:"dclid",valueType:"text",maxLength:void 0,defaultValue:void 0},Ad:{id:"pageLoadTime",name:"plt",valueType:"integer",maxLength:void 0,defaultValue:void 0},hd:{id:"dnsTime",name:"dns",valueType:"integer",maxLength:void 0,defaultValue:void 0},Md:{id:"tcpConnectTime",name:"tcp",valueType:"integer",maxLength:void 0,defaultValue:void 0},Gd:{id:"serverResponseTime",name:"srt",valueType:"integer",
maxLength:void 0,defaultValue:void 0},zd:{id:"pageDownloadTime",name:"pdt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Cd:{id:"redirectResponseTime",name:"rrt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Nd:{id:"timingCategory",name:"utc",valueType:"text",maxLength:150,defaultValue:void 0},Qd:{id:"timingVar",name:"utv",valueType:"text",maxLength:500,defaultValue:void 0},Pd:{id:"timingValue",name:"utt",valueType:"integer",maxLength:void 0,defaultValue:void 0},Od:{id:"timingLabel",
name:"utl",valueType:"text",maxLength:500,defaultValue:void 0},nd:{id:"exDescription",name:"exd",valueType:"text",maxLength:150,defaultValue:void 0},od:{id:"exFatal",name:"exf",valueType:"boolean",maxLength:void 0,defaultValue:"1"}},Fc=function(b){if(1>b||200<b)throw Error("Expected dimension index range 1-200, but was : "+b);return{id:"dimension"+b,name:"cd"+b,valueType:"text",maxLength:150,defaultValue:void 0}},Gc=function(b){if(1>b||200<b)throw Error("Expected metric index range 1-200, but was : "+
b);return{id:"metric"+b,name:"cm"+b,valueType:"integer",maxLength:void 0,defaultValue:void 0}},Hc=function(b){if(1>b)return"0";if(3>b)return"1-2";b=Math.floor(Math.log(b-1)/Math.log(2));return Math.pow(2,b)+1+"-"+Math.pow(2,b+1)},gd=function(b,m){for(var a=0,d=b.length-1,c=0;a<=d;){var e=Math.floor((a+d)/2),c=b[e];if(m<=c){d=0==e?0:b[e-1];if(m>d)return(d+1).toString()+"-"+c.toString();d=e-1}else if(m>c){if(e>=b.length-1)return(b[b.length-1]+1).toString()+"+";a=e+1}}return"<= 0"},La=function(){this.bb=
[]},Ic=function(){return new La};c=La.prototype;c.when=function(b){this.bb.push(b);return this};c.Ab=function(b){var m=arguments;this.when(function(b){return 0<=ta(m,b.Ib())});return this};c.Pc=function(b,m){var a=ed(arguments,1);this.when(function(m){m=m.W().get(b);return 0<=ta(a,m)});return this};c.zb=function(b,m){if(x(this.g))throw Error("Filter has already been set.");this.g=x(m)?z(b,m):b;return this};c.Da=function(){if(0==this.bb.length)throw Error("Must specify at least one predicate using #when or a helper method.");
if(!x(this.g))throw Error("Must specify a delegate filter using #applyFilter.");return z(function(b){S(this.bb,function(m){return m(b)})&&this.g(b)},this)};var T=function(){this.Cb=!1;this.Db="";this.sb=!1;this.Aa=null};T.prototype.xc=function(b){this.Cb=!0;this.Db=b||" - ";return this};T.prototype.Oc=function(){this.sb=!0;return this};T.prototype.Fc=function(){return Jc(this,Hc)};T.prototype.Gc=function(b){return Jc(this,A(gd,b))};var Jc=function(b,m){if(null!=b.Aa)throw Error("LabelerBuilder: Only one labeling strategy may be used.");
b.Aa=z(function(b){var a=b.W().get(Ab),d=b.W().get(kb);p(a)&&(a=m(a),null!=d&&this.Cb&&(a=d+this.Db+a),b.W().set(kb,a))},b);return b};T.prototype.Da=function(){if(null==this.Aa)throw Error("LabelerBuilder: a labeling strategy must be specified prior to calling build().");return Ic().Ab("event").zb(z(function(b){this.Aa(b);this.sb&&b.W().remove(Ab)},this)).Da()};var ua=function(b,m){var a=Array.prototype.slice.call(arguments),d=a.shift();if("undefined"==typeof d)throw Error("[goog.string.format] Template required");
return d.replace(/%([0\-\ \+]*)(\d+)?(\.(\d+))?([%sfdiu])/g,function(b,m,d,c,e,h,f,n){if("%"==h)return"%";var k=a.shift();if("undefined"==typeof k)throw Error("[goog.string.format] Not enough arguments");arguments[0]=k;return lb[h].apply(null,arguments)})},lb={s:function(b,m,a){return isNaN(a)||""==a||b.length>=a?b:-1<m.indexOf("-",0)?b+Array(a-b.length+1).join(" "):Array(a-b.length+1).join(" ")+b},f:function(b,m,a,d,c){d=b.toString();isNaN(c)||""==c||(d=b.toFixed(c));var e;e=0>b?"-":0<=m.indexOf("+")?
"+":0<=m.indexOf(" ")?" ":"";0<=b&&(d=e+d);if(isNaN(a)||d.length>=a)return d;d=isNaN(c)?Math.abs(b).toString():Math.abs(b).toFixed(c);b=a-d.length-e.length;return 0<=m.indexOf("-",0)?e+d+Array(b+1).join(" "):e+Array(b+1).join(0<=m.indexOf("0",0)?"0":" ")+d},d:function(b,m,a,d,c,e,h,f){return lb.f(parseInt(b,10),m,a,d,0,e,h,f)}};lb.i=lb.d;lb.u=lb.d;var hc=function(b){if("function"==typeof b.w)return b.w();if(h(b))return b.split("");if(v(b)){for(var m=[],a=b.length,d=0;d<a;d++)m.push(b[d]);return m}return Ca(b)},
hd=function(b,m){if("function"==typeof b.forEach)b.forEach(m,void 0);else if(v(b)||h(b))t(b,m,void 0);else{var a;if("function"==typeof b.H)a=b.H();else if("function"!=typeof b.w)if(v(b)||h(b)){a=[];for(var d=b.length,c=0;c<d;c++)a.push(c)}else a=xb(b);else a=void 0;for(var d=hc(b),c=d.length,e=0;e<c;e++)m.call(void 0,d[e],a&&a[e],b)}},aa=function(b){this.F=new ea;if(0<arguments.length%2)throw Error("Uneven number of arguments to ParameterMap constructor.");for(var m=arguments,a=0;a<m.length;a+=2)this.set(m[a],
m[a+1])};aa.prototype.set=function(b,m){if(null==m)throw Error("undefined-or-null value for key: "+b.name);this.F.set(b.name,{key:b,value:m})};aa.prototype.remove=function(b){this.F.remove(b.name)};aa.prototype.get=function(b){b=this.F.get(b.name,null);return null===b?null:b.value};aa.prototype.la=function(b){this.F.la(b.F)};var mb=function(b,m){t(b.F.w(),function(b){m(b.key,b.value)})};aa.prototype.Lb=function(){var b={};mb(this,function(m,a){b[m.id]=a});return b};aa.prototype.clone=function(){var b=
new aa;b.F=this.F.clone();return b};aa.prototype.toString=function(){var b={};mb(this,function(m,a){b[m.id]=a});return JSON.stringify(b)};var V=function(b){this.g=b};c=V.prototype;c.yc=function(b){var m=new V(z(this.Q,this));m.I=fc;m.M=b;return m};c.action=function(b){var m=new V(z(this.Q,this));m.I=gc;m.M=b;return m};c.label=function(b){var m=new V(z(this.Q,this));m.I=kb;m.M=b;return m};c.value=function(b){var m=new V(z(this.Q,this));m.I=Ab;m.M=b;return m};c.zc=function(b){var m=new V(z(this.Q,this));
m.I=Fc(b.index);m.M=b.value;return m};c.Ec=function(b){var m=new V(z(this.Q,this));m.I=Gc(b.index);m.M=b.value;return m};c.send=function(b){var m=new aa;this.Q(m);return b.send("event",m)};c.Q=function(b){null!=this.I&&null!=this.M&&!b.F.R(this.I.name)&&b.set(this.I,this.M);x(this.g)&&this.g(b)};var id=new V(a),bb=function(){this.ba=this.ba;this.Ea=this.Ea};bb.prototype.ba=!1;bb.prototype.$=function(){this.ba||(this.ba=!0,this.l())};bb.prototype.l=function(){if(this.Ea)for(;this.Ea.length;)this.Ea.shift()()};
var Ma=function(b,m){this.type=b;this.currentTarget=this.target=m;this.defaultPrevented=this.X=!1;this.nb=!0};Ma.prototype.l=function(){};Ma.prototype.$=function(){};Ma.prototype.preventDefault=function(){this.defaultPrevented=!0;this.nb=!1};var ba=function(b){ba[" "](b);return b};ba[" "]=a;var qa;a:{var Nb=l.navigator;if(Nb){var Ea=Nb.userAgent;if(Ea){qa=Ea;break a}}qa=""}var va=function(b){return-1!=qa.indexOf(b)},Na=va("Opera")||va("OPR"),O=va("Trident")||va("MSIE"),Y=va("Gecko")&&-1==qa.toLowerCase().indexOf("webkit")&&
!(va("Trident")||va("MSIE")),la=-1!=qa.toLowerCase().indexOf("webkit"),Ob=function(){var b=l.document;return b?b.documentMode:void 0},nb=function(){var b="",m;if(Na&&l.opera)return b=l.opera.version,y(b)?b():b;Y?m=/rv\:([^\);]+)(\)|;)/:O?m=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:la&&(m=/WebKit\/(\S+)/);m&&(b=(b=m.exec(qa))?b[1]:"");return O&&(m=Ob(),m>parseFloat(b))?String(m):b}(),Pb={},I=function(b){var m;if(!(m=Pb[b])){m=0;for(var a=ca(String(nb)).split("."),d=ca(String(b)).split("."),c=Math.max(a.length,
d.length),e=0;0==m&&e<c;e++){var h=a[e]||"",f=d[e]||"",n=/(\d*)(\D*)/g,k=/(\d*)(\D*)/g;do{var l=n.exec(h)||["","",""],t=k.exec(f)||["","",""];if(0==l[0].length&&0==t[0].length)break;m=da(0==l[1].length?0:parseInt(l[1],10),0==t[1].length?0:parseInt(t[1],10))||da(0==l[2].length,0==t[2].length)||da(l[2],t[2])}while(0==m)}m=Pb[b]=0<=m}return m},B=l.document,cb=B&&O?Ob()||("CSS1Compat"==B.compatMode?parseInt(nb,10):5):void 0,ia=!O||O&&9<=cb,Oa=O&&!I("9"),ja=!la||I("528"),jd=Y&&I("1.9b")||O&&I("8")||Na&&
I("9.5")||la&&I("528"),qe=Y&&!I("8")||O&&!I("9"),Qb=function(b,m){Ma.call(this,b?b.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.Fb=this.state=null;if(b){var a=this.type=b.type;this.target=b.target||b.srcElement;this.currentTarget=m;var d=b.relatedTarget;if(d){if(Y){var c;a:{try{ba(d.nodeName);c=!0;break a}catch(e){}c=
!1}c||(d=null)}}else"mouseover"==a?d=b.fromElement:"mouseout"==a&&(d=b.toElement);this.relatedTarget=d;this.offsetX=la||void 0!==b.offsetX?b.offsetX:b.layerX;this.offsetY=la||void 0!==b.offsetY?b.offsetY:b.layerY;this.clientX=void 0!==b.clientX?b.clientX:b.pageX;this.clientY=void 0!==b.clientY?b.clientY:b.pageY;this.screenX=b.screenX||0;this.screenY=b.screenY||0;this.button=b.button;this.keyCode=b.keyCode||0;this.charCode=b.charCode||("keypress"==a?b.keyCode:0);this.ctrlKey=b.ctrlKey;this.altKey=
b.altKey;this.shiftKey=b.shiftKey;this.metaKey=b.metaKey;this.state=b.state;this.Fb=b;b.defaultPrevented&&this.preventDefault()}};H(Qb,Ma);Qb.prototype.preventDefault=function(){Qb.K.preventDefault.call(this);var b=this.Fb;if(b.preventDefault)b.preventDefault();else if(b.returnValue=!1,Oa)try{if(b.ctrlKey||112<=b.keyCode&&123>=b.keyCode)b.keyCode=-1}catch(m){}};Qb.prototype.l=function(){};var db="closure_listenable_"+(1E6*Math.random()|0),ra=function(b){return!(!b||!b[db])},Qd=0,kd=function(b,m,a,
d,c){this.O=b;this.proxy=null;this.src=m;this.type=a;this.sa=!!d;this.va=c;this.key=++Qd;this.removed=this.ta=!1},Fa=function(b){b.removed=!0;b.O=null;b.proxy=null;b.src=null;b.va=null},za=function(b){this.src=b;this.k={};this.ca=0};za.prototype.add=function(b,m,a,d,c){var e=b.toString();(b=this.k[e])||(b=this.k[e]=[],this.ca++);var h=Pa(b,m,d,c);-1<h?(m=b[h],a||(m.ta=!1)):(m=new kd(m,this.src,e,!!d,c),m.ta=a,b.push(m));return m};za.prototype.remove=function(b,m,a,d){b=b.toString();if(!(b in this.k))return!1;
var c=this.k[b];m=Pa(c,m,a,d);return-1<m?(Fa(c[m]),F.splice.call(c,m,1),0==c.length&&(delete this.k[b],this.ca--),!0):!1};var Aa=function(b,m){var a=m.type;if(!(a in b.k))return!1;var d=cc(b.k[a],m);d&&(Fa(m),0==b.k[a].length&&(delete b.k[a],b.ca--));return d};za.prototype.removeAll=function(b){b=b&&b.toString();var m=0,a;for(a in this.k)if(!b||a==b){for(var d=this.k[a],c=0;c<d.length;c++)++m,Fa(d[c]);delete this.k[a];this.ca--}return m};za.prototype.aa=function(b,m,a,d){b=this.k[b.toString()];var c=
-1;b&&(c=Pa(b,m,a,d));return-1<c?b[c]:null};var Pa=function(b,m,a,d){for(var c=0;c<b.length;++c){var e=b[c];if(!e.removed&&e.O==m&&e.sa==!!a&&e.va==d)return c}return-1},re="closure_lm_"+(1E6*Math.random()|0),d={},Ne=0,ld=function(b,m,a,d,c){if(n(m)){for(var e=0;e<m.length;e++)ld(b,m[e],a,d,c);return null}a=ic(a);return ra(b)?b.listen(m,a,d,c):K(b,m,a,!1,d,c)},K=function(b,m,a,d,c,e){if(!m)throw Error("Invalid event type");var h=!!c,f=Rb(b);f||(b[re]=f=new za(b));a=f.add(m,a,d,c,e);if(a.proxy)return a;
d=vf();a.proxy=d;d.src=b;d.O=a;b.addEventListener?b.addEventListener(m.toString(),d,h):b.attachEvent(Qa(m.toString()),d);Ne++;return a},vf=function(){var b=wf,m=ia?function(a){return b.call(m.src,m.O,a)}:function(a){a=b.call(m.src,m.O,a);if(!a)return a};return m},Oe=function(b,m,a,d,c){if(n(m)){for(var e=0;e<m.length;e++)Oe(b,m[e],a,d,c);return null}a=ic(a);return ra(b)?b.cb(m,a,d,c):K(b,m,a,!0,d,c)},Pe=function(b,m,a,d,c){if(n(m))for(var e=0;e<m.length;e++)Pe(b,m[e],a,d,c);else a=ic(a),ra(b)?b.Wa(m,
a,d,c):b&&(b=Rb(b))&&(m=b.aa(m,a,!!d,c))&&md(m)},md=function(b){if(p(b)||!b||b.removed)return!1;var m=b.src;if(ra(m))return Aa(m.D,b);var a=b.type,d=b.proxy;m.removeEventListener?m.removeEventListener(a,d,b.sa):m.detachEvent&&m.detachEvent(Qa(a),d);Ne--;(a=Rb(m))?(Aa(a,b),0==a.ca&&(a.src=null,m[re]=null)):Fa(b);return!0},Qa=function(b){return b in d?d[b]:d[b]="on"+b},Re=function(b,m,a,d){var c=1;if(b=Rb(b))if(m=b.k[m.toString()])for(m=m.concat(),b=0;b<m.length;b++){var e=m[b];e&&e.sa==a&&!e.removed&&
(c&=!1!==Qe(e,d))}return Boolean(c)},Qe=function(b,m){var a=b.O,d=b.va||b.src;b.ta&&md(b);return a.call(d,m)},wf=function(b,m){if(b.removed)return!0;if(!ia){var a;if(!(a=m))a:{a=["window","event"];for(var d=l,c;c=a.shift();)if(null!=d[c])d=d[c];else{a=null;break a}a=d}c=a;a=new Qb(c,this);d=!0;if(!(0>c.keyCode||void 0!=c.returnValue)){a:{var e=!1;if(0==c.keyCode)try{c.keyCode=-1;break a}catch(h){e=!0}if(e||void 0==c.returnValue)c.returnValue=!0}c=[];for(e=a.currentTarget;e;e=e.parentNode)c.push(e);
for(var e=b.type,f=c.length-1;!a.X&&0<=f;f--)a.currentTarget=c[f],d&=Re(c[f],e,!0,a);for(f=0;!a.X&&f<c.length;f++)a.currentTarget=c[f],d&=Re(c[f],e,!1,a)}return d}return Qe(b,new Qb(m,this))},Rb=function(b){b=b[re];return b instanceof za?b:null},jc="__closure_events_fn_"+(1E9*Math.random()>>>0),ic=function(b){if(y(b))return b;b[jc]||(b[jc]=function(m){return b.handleEvent(m)});return b[jc]},Z=function(){bb.call(this);this.D=new za(this);this.mc=this;this.Ra=null};H(Z,bb);Z.prototype[db]=!0;c=Z.prototype;
c.addEventListener=function(b,m,a,d){ld(this,b,m,a,d)};c.removeEventListener=function(b,m,a,d){Pe(this,b,m,a,d)};c.dispatchEvent=function(b){var m,a=this.Ra;if(a){m=[];for(var d=1;a;a=a.Ra)m.push(a),++d}a=this.mc;d=b.type||b;if(h(b))b=new Ma(b,a);else if(b instanceof Ma)b.target=b.target||a;else{var c=b;b=new Ma(d,a);Mb(b,c)}var c=!0,e;if(m)for(var f=m.length-1;!b.X&&0<=f;f--)e=b.currentTarget=m[f],c=Kc(e,d,!0,b)&&c;b.X||(e=b.currentTarget=a,c=Kc(e,d,!0,b)&&c,b.X||(c=Kc(e,d,!1,b)&&c));if(m)for(f=
0;!b.X&&f<m.length;f++)e=b.currentTarget=m[f],c=Kc(e,d,!1,b)&&c;return c};c.l=function(){Z.K.l.call(this);this.D&&this.D.removeAll(void 0);this.Ra=null};c.listen=function(b,m,a,d){return this.D.add(String(b),m,!1,a,d)};c.cb=function(b,a,d,c){return this.D.add(String(b),a,!0,d,c)};c.Wa=function(b,a,d,c){return this.D.remove(String(b),a,d,c)};var Kc=function(b,a,d,c){a=b.D.k[String(a)];if(!a)return!0;a=a.concat();for(var e=!0,h=0;h<a.length;++h){var f=a[h];if(f&&!f.removed&&f.sa==d){var n=f.O,k=f.va||
f.src;f.ta&&Aa(b.D,f);e=!1!==n.call(k,c)&&e}}return e&&0!=c.nb};Z.prototype.aa=function(b,a,d,c){return this.D.aa(String(b),a,d,c)};var nd=function(b){l.setTimeout(function(){throw b;},0)},kc,od=function(){var b=l.MessageChannel;"undefined"===typeof b&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&(b=function(){var b=document.createElement("iframe");b.style.display="none";b.src="";document.documentElement.appendChild(b);var a=b.contentWindow,b=a.document;b.open();b.write("");
b.close();var m="callImmediate"+Math.random(),d="file:"==a.location.protocol?"*":a.location.protocol+"//"+a.location.host,b=z(function(b){if(("*"==d||b.origin==d)&&b.data==m)this.port1.onmessage()},this);a.addEventListener("message",b,!1);this.port1={};this.port2={postMessage:function(){a.postMessage(m,d)}}});if("undefined"!==typeof b&&!va("Trident")&&!va("MSIE")){var a=new b,d={},c=d;a.port1.onmessage=function(){if(f(d.next)){d=d.next;var b=d.Hb;d.Hb=null;b()}};return function(b){c.next={Hb:b};c=
c.next;a.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("script")?function(b){var a=document.createElement("script");a.onreadystatechange=function(){a.onreadystatechange=null;a.parentNode.removeChild(a);a=null;b();b=null};document.documentElement.appendChild(a)}:function(b){l.setTimeout(b,0)}},Sa=function(b,a){Ra||Sb();wa||(Ra(),wa=!0);Lc.push(new Rd(b,a))},Ra,Sb=function(){if(l.Promise&&l.Promise.resolve){var b=l.Promise.resolve();Ra=function(){b.then(Bb)}}else Ra=
function(){var b=Bb;!y(l.setImmediate)||l.Window&&l.Window.prototype.setImmediate==l.setImmediate?(kc||(kc=od()),kc(b)):l.setImmediate(b)}},wa=!1,Lc=[],Bb=function(){for(;Lc.length;){var b=Lc;Lc=[];for(var a=0;a<b.length;a++){var d=b[a];try{d.Ac.call(d.scope)}catch(c){nd(c)}}}wa=!1},Rd=function(b,a){this.Ac=b;this.scope=a},ob=function(b){b.prototype.then=b.prototype.then;b.prototype.$goog_Thenable=!0},Sd=function(b){if(!b)return!1;try{return!!b.$goog_Thenable}catch(a){return!1}},eb=function(b,a){this.n=
0;this.B=void 0;this.o=this.p=null;this.wa=this.Ma=!1;try{var d=this;b.call(a,function(b){pb(d,2,b)},function(b){pb(d,3,b)})}catch(c){pb(this,3,c)}};eb.prototype.then=function(b,a,d){return Ga(this,y(b)?b:null,y(a)?a:null,d)};ob(eb);eb.prototype.cancel=function(b){0==this.n&&Sa(function(){var a=new Cb(b);R(this,a)},this)};var R=function(b,a){if(0==b.n)if(b.p){var d=b.p;if(d.o){for(var c=0,e=-1,h=0,f;f=d.o[h];h++)if(f=f.xa)if(c++,f==b&&(e=h),0<=e&&1<c)break;0<=e&&(0==d.n&&1==c?R(d,a):(c=d.o.splice(e,
1)[0],Mc(d),c.Oa(a)))}}else pb(b,3,a)},xf=function(b,a){b.o&&b.o.length||2!=b.n&&3!=b.n||b.Ma||(b.Ma=!0,Sa(b.vc,b));b.o||(b.o=[]);b.o.push(a)},Ga=function(b,a,d,c){var e={xa:null,kb:null,Oa:null};e.xa=new eb(function(b,h){e.kb=a?function(d){try{var e=a.call(c,d);b(e)}catch(f){h(f)}}:b;e.Oa=d?function(a){try{var m=d.call(c,a);!f(m)&&a instanceof Cb?h(a):b(m)}catch(e){h(e)}}:h});e.xa.p=b;xf(b,e);return e.xa};eb.prototype.xb=function(b){this.n=0;pb(this,2,b)};eb.prototype.yb=function(b){this.n=0;pb(this,
3,b)};var pb=function(b,a,d){if(0==b.n){if(b==d)a=3,d=new TypeError("Promise cannot resolve to itself");else{if(Sd(d)){b.n=1;d.then(b.xb,b.yb,b);return}if(x(d))try{var c=d.then;if(y(c)){Nc(b,d,c);return}}catch(e){a=3,d=e}}b.B=d;b.n=a;b.Ma||(b.Ma=!0,Sa(b.vc,b));3!=a||d instanceof Cb||pd(b,d)}},Nc=function(b,a,d){b.n=1;var c=!1,e=function(a){c||(c=!0,b.xb(a))},h=function(a){c||(c=!0,b.yb(a))};try{d.call(a,e,h)}catch(f){h(f)}};eb.prototype.vc=function(){for(;this.o&&this.o.length;){var b=this.o;this.o=
[];for(var a=0;a<b.length;a++){var d=b[a],c=this.B;2==this.n?d.kb(c):(Mc(this),d.Oa(c))}}this.Ma=!1};var Mc=function(b){for(;b&&b.wa;b=b.p)b.wa=!1},pd=function(b,a){b.wa=!0;Sa(function(){b.wa&&yf.call(null,a)})},yf=nd,Cb=function(b){Q.call(this,b)};H(Cb,Q);Cb.prototype.name="cancel";var W=function(b,a){this.ma=[];this.ib=b;this.hb=a||null;this.Z=this.A=!1;this.B=void 0;this.La=this.Nb=this.Ka=!1;this.na=0;this.p=null;this.Ja=0};W.prototype.cancel=function(b){if(this.A)this.B instanceof W&&this.B.cancel();
else{if(this.p){var a=this.p;delete this.p;b?a.cancel(b):(a.Ja--,0>=a.Ja&&a.cancel())}this.ib?this.ib.call(this.hb,this):this.La=!0;this.A||this.C(new Tb)}};W.prototype.jb=function(b,a){this.Ka=!1;Db(this,b,a)};var Db=function(b,a,d){b.A=!0;b.B=d;b.Z=!a;qd(b)},qb=function(b){if(b.A){if(!b.La)throw new Eb;b.La=!1}};W.prototype.t=function(b){qb(this);Db(this,!0,b)};W.prototype.C=function(b){qb(this);Db(this,!1,b)};W.prototype.N=function(b,a){return rb(this,b,null,a)};var rb=function(b,a,d,c){b.ma.push([a,
d,c]);b.A&&qd(b);return b};W.prototype.then=function(b,a,d){var c,e,h=new eb(function(b,a){c=b;e=a});rb(this,c,function(b){b instanceof Tb?h.cancel():e(b)});return h.then(b,a,d)};ob(W);var lc=function(b){var a=new W;rb(b,a.t,a.C,a);return a},rd=function(b){return U(b.ma,function(b){return y(b[1])})},qd=function(b){if(b.na&&b.A&&rd(b)){var a=b.na,d=mc[a];d&&(l.clearTimeout(d.pa),delete mc[a]);b.na=0}b.p&&(b.p.Ja--,delete b.p);for(var a=b.B,c=d=!1;b.ma.length&&!b.Ka;){var e=b.ma.shift(),h=e[0],n=e[1],
e=e[2];if(h=b.Z?n:h)try{var k=h.call(e||b.hb,a);f(k)&&(b.Z=b.Z&&(k==a||k instanceof Error),b.B=a=k);Sd(a)&&(c=!0,b.Ka=!0)}catch(t){a=t,b.Z=!0,rd(b)||(d=!0)}}b.B=a;c&&(k=z(b.jb,b,!0),c=z(b.jb,b,!1),a instanceof W?(rb(a,k,c),a.Nb=!0):a.then(k,c));d&&(a=new sd(a),mc[a.pa]=a,b.na=a.pa)},Ub=function(b){var a=new W;a.t(b);return a},Ud=function(){var b=Td,a=new W;a.C(b);return a},Eb=function(){Q.call(this)};H(Eb,Q);Eb.prototype.message="Deferred has already fired";Eb.prototype.name="AlreadyCalledError";
var Tb=function(){Q.call(this)};H(Tb,Q);Tb.prototype.message="Deferred was canceled";Tb.prototype.name="CanceledError";var sd=function(b){this.pa=l.setTimeout(z(this.qc,this),0);this.ka=b};sd.prototype.qc=function(){delete mc[this.pa];throw this.ka;};var mc={},nc=function(b){this.ab=[];this.g=b};nc.prototype.V=function(b){if(!y(b))throw Error("Invalid filter. Must be a function.");this.ab.push(b)};nc.prototype.send=function(b,a){for(var d=new sb(b,a),c=0;c<this.ab.length&&(this.ab[c](d),!d.Za);c++);
return d.Za?Ub():this.g.send(b,a)};var sb=function(b,a){this.sc=b;this.rc=a;this.Za=!1};sb.prototype.Ib=function(){return this.sc};sb.prototype.W=function(){return this.rc};sb.prototype.cancel=function(){this.Za=!0};var oc=function(b,a){this.width=b;this.height=a};oc.prototype.clone=function(){return new oc(this.width,this.height)};oc.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};!Y&&!O||O&&O&&9<=cb||Y&&I("1.9.1");O&&I("9");var td={id:"apiVersion",
name:"v",valueType:"text",maxLength:void 0,defaultValue:void 0},Oc={id:"appName",name:"an",valueType:"text",maxLength:100,defaultValue:void 0},Pc={id:"appVersion",name:"av",valueType:"text",maxLength:100,defaultValue:void 0},Ha={id:"clientId",name:"cid",valueType:"text",maxLength:void 0,defaultValue:void 0},Vd={id:"language",name:"ul",valueType:"text",maxLength:20,defaultValue:void 0},pc={id:"libVersion",name:"_v",valueType:"text",maxLength:void 0,defaultValue:void 0},qc={id:"sampleRateOverride",
name:"usro",valueType:"integer",maxLength:void 0,defaultValue:void 0},ud={id:"screenColors",name:"sd",valueType:"text",maxLength:20,defaultValue:void 0},tb={id:"screenResolution",name:"sr",valueType:"text",maxLength:20,defaultValue:void 0},rc={id:"trackingId",name:"tid",valueType:"text",maxLength:void 0,defaultValue:void 0},vd={id:"viewportSize",name:"vp",valueType:"text",maxLength:20,defaultValue:void 0},wd={Sc:td,Vc:Oc,Wc:Pc,dd:Ha,wd:Vd,xd:pc,Dd:qc,Ed:ud,Fd:tb,Sd:rc,Zd:vd},xd=function(b){if(!h(b))return b;
var a=Wd(b,Ec);if(x(a))return a;a=Wd(b,wd);if(x(a))return a;a=/^dimension(\d+)$/.exec(b);if(null!==a)return Fc(parseInt(a[1],10));a=/^metric(\d+)$/.exec(b);if(null!==a)return Gc(parseInt(a[1],10));throw Error(b+" is not a valid parameter name.");},Wd=function(b,a){var d=ec(a,function(a){return a.id==b&&"metric"!=b&&"dimension"!=b});return x(d)?d:null},xa=function(b,a){this.bc=a;this.r=a.Ta();this.ub=new aa;this.Ya=!1};c=xa.prototype;c.set=function(b,a){if(null==a)throw Error("Value must be defined and not null. Parameter="+
b.id);var d=xd(b);this.ub.set(d,a)};c.V=function(b){this.bc.V(b)};c.send=function(b,a){if(b instanceof V)return b.send(this);var d=this.ub.clone();a instanceof aa?d.la(a):x(a)&&$a(a,function(b,a){null!=b&&d.set(xd(a),b)},this);this.Ya&&(this.Ya=!1,d.set(zb,"start"));return this.r.send(b,d)};c.Hc=function(b){var a={description:b};this.set(Dc,b);return this.send("appview",a)};c.Ic=function(b,a,d,c){return this.send("event",{eventCategory:b,eventAction:a,eventLabel:d,eventValue:c})};c.Kc=function(b,
a,d){return this.send("social",{socialNetwork:b,socialAction:a,socialTarget:d})};c.Jc=function(b,a){return this.send("exception",{exDescription:b,exFatal:a})};c.Eb=function(b,a,d,c,e){return this.send("timing",{timingCategory:b,timingVar:a,timingLabel:c,timingValue:d,sampleRateOverride:e})};c.Bc=function(){this.Ya=!0};c.Nc=function(b,a,d,c){return new sc(this,b,a,d,c)};var sc=function(b,a,d,c,e){this.Bb=b;this.hc=a;this.kc=d;this.ic=c;this.qa=e;this.jc=E()};sc.prototype.send=function(){var b=this.Bb.Eb(this.hc,
this.kc,E()-this.jc,this.ic,this.qa);this.Bb=null;return b};var Fb=function(b,a,d,c,e){this.gc=b;this.dc=a;this.ec=d;this.e=c;this.fc=e};Fb.prototype.Dc=function(b){var a=new xa(0,this.fc.create());a.set(pc,this.gc);a.set(td,1);a.set(Oc,this.dc);a.set(Pc,this.ec);a.set(rc,b);(b=navigator.language||navigator.browserLanguage)&&a.set(Vd,b);(b=screen.colorDepth+"-bit")&&a.set(ud,b);(b=[screen.width,screen.height].join("x"))&&a.set(tb,b);b=window.document;b="CSS1Compat"==b.compatMode?b.documentElement:
b.body;b=new oc(b.clientWidth,b.clientHeight);(b=[b.width,b.height].join("x"))&&a.set(vd,b);return a};Fb.prototype.Cc=function(){return lc(this.e.Y)};var ka=function(b){this.tc=b};ka.prototype.send=function(b,a){this.tc.push({Ub:b,Vb:a});return Ub()};var fb=function(b,a,d){this.e=b;this.T=[];this.L={enabled:new ka(this.T),disabled:d};this.r=this.L.enabled;rb(lc(this.e.Y),A(this.Rb,a),this.Qb,this)};fb.prototype.Rb=function(b,a){if(null===this.T)throw Error("Channel setup already completed.");if(a!=
this.e)throw Error("Yikes! Multiple settings instances!");this.L.enabled=b();Qc(this);t(this.T,function(b){this.send(b.Ub,b.Vb)},this);this.T=null;se(this.e,z(this.Yb,this))};fb.prototype.Qb=function(){if(null===this.T)throw Error("Channel setup already completed.");this.r=this.L.enabled=this.L.disabled;this.T=null};fb.prototype.send=function(b,a){return this.r.send(b,a)};var Qc=function(b){b.r=b.e.ya()?b.L.enabled:b.L.disabled};fb.prototype.Yb=function(b){switch(b){case "analytics.tracking-permitted":Qc(this)}};
var Vb=function(b,a,d,c,e,h){W.call(this,e,h);this.Na=b;this.Pa=[];this.lb=!!a;this.Pb=!!d;this.Ob=!!c;for(a=this.mb=0;a<b.length;a++)rb(b[a],z(this.tb,this,a,!0),z(this.tb,this,a,!1));0!=b.length||this.lb||this.t(this.Pa)};H(Vb,W);Vb.prototype.tb=function(b,a,d){this.mb++;this.Pa[b]=[a,d];this.A||(this.lb&&a?this.t([b,d]):this.Pb&&!a?this.C(d):this.mb==this.Na.length&&this.t(this.Pa));this.Ob&&!a&&(d=null);return d};Vb.prototype.C=function(b){Vb.K.C.call(this,b);for(b=0;b<this.Na.length;b++)this.Na[b].cancel()};
var Rc=function(b){return(new Vb(b,!1,!0)).N(function(b){for(var a=[],d=0;d<b.length;d++)a[d]=b[d][1];return a})},ma=function(b){this.m=b;this.qa=100;this.ob=[];this.U=this.Qa=null;this.Y=Xd(this);this.Y.N(function(){this.pb=ld(this.m,"a",z(this.Sb,this))},this)},Xd=function(b){return yd(b).N(function(){return this},b)},yd=function(b){return Rc([Yd(b),tc(b)])};ma.prototype.Sb=function(){Ta(this);var b=ub(this),a=this.ya();yd(this).N(function(){if(b!=ub(this))throw Error("User ID changed unexpectedly!");
a!=this.ya()&&zd(this)},this)};var se=function(b,a){Ta(b);b.ob.push(a)};ma.prototype.Mc=function(b){Ta(this);var a=this.U!=b;this.U=b;this.m.set("analytics.tracking-permitted",b.toString());a&&zd(this)};ma.prototype.ya=function(){Ta(this);var b;if(b=this.U)b=l._gaUserPrefs,b=!(b&&b.ioo&&b.ioo());return b};var Yd=function(b){return b.m.get("analytics.tracking-permitted").N(function(b){this.U=!0;if(f(b))switch(b){case "true":this.U=!0;break;case "false":this.U=!1}},b)},ub=function(b){Ta(b);if(!h(b.Qa))throw Error("Invalid state. UserID is not a string.");
return b.Qa},tc=function(b){return b.m.get("analytics.user-id").N(function(b){if(!f(b)){b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".split("");for(var a=0,d=b.length;a<d;a++)switch(b[a]){case "x":b[a]=Math.floor(16*Math.random()).toString(16);break;case "y":b[a]=(Math.floor(4*Math.random())+8).toString(16)}b=b.join("");this.m.set("analytics.user-id",b)}this.Qa=b},b)};ma.prototype.Lc=function(b){Ta(this);this.qa=b};var Zd=function(b){Ta(b);return b.qa},zd=function(b){t(b.ob,function(b){b("analytics.tracking-permitted")})};
ma.prototype.$=function(){null!=this.pb&&md(this.pb)};var Ta=function(b){if(!lc(b.Y).A)throw Error("Settings object accessed prior to entering ready state.");},Wb=function(){Z.call(this);this.P="google-analytics";this.m=chrome.storage.local;chrome.storage.onChanged.addListener(z(this.$a,this))};H(Wb,Z);Wb.prototype.$a=function(b){Ad(this,b)&&this.dispatchEvent("a")};var Ad=function(b,a){return U(xb(a),function(b){return 0==b.lastIndexOf(this.P,0)},b)};Wb.prototype.get=function(b){var a=new W,d=this.P+
"."+b;this.m.get(d,function(b){chrome.runtime.lastError?a.C(chrome.runtime.lastError):(b=b[d],a.t(null!=b?b.toString():void 0))});return a};Wb.prototype.set=function(b,a){var d=new W,c={};c[this.P+"."+b]=a;this.m.set(c,function(){chrome.runtime.lastError?d.C(chrome.runtime.lastError):d.t()});return d};var Gb=function(b,a){Z.call(this);this.za=b||1;this.S=a||l;this.Sa=z(this.nc,this);this.Ua=E()};H(Gb,Z);c=Gb.prototype;c.enabled=!1;c.h=null;c.nc=function(){if(this.enabled){var b=E()-this.Ua;0<b&&b<
.8*this.za?this.h=this.S.setTimeout(this.Sa,this.za-b):(this.h&&(this.S.clearTimeout(this.h),this.h=null),this.dispatchEvent("tick"),this.enabled&&(this.h=this.S.setTimeout(this.Sa,this.za),this.Ua=E()))}};c.start=function(){this.enabled=!0;this.h||(this.h=this.S.setTimeout(this.Sa,this.za),this.Ua=E())};c.stop=function(){this.enabled=!1;this.h&&(this.S.clearTimeout(this.h),this.h=null)};c.l=function(){Gb.K.l.call(this);this.stop();delete this.S};var Sc=function(b,a,d){if(y(b))d&&(b=z(b,d));else if(b&&
"function"==typeof b.handleEvent)b=z(b.handleEvent,b);else throw Error("Invalid listener argument");return 2147483647<a?-1:l.setTimeout(b,a||0)},Xb=function(){Z.call(this);this.P="google-analytics";this.m=window.localStorage;ld(window,"storage",z(this.$a,this),!1)};H(Xb,Z);Xb.prototype.get=function(b){var a=Bd(this,b),d=new W;Sc(function(){d.t(a)});return d};Xb.prototype.set=function(b,a){a!=Bd(this,b)&&(this.m.setItem(this.P+"."+b,a),this.dispatchEvent("a"));var d=new W;Sc(function(){d.t()});return d};
Xb.prototype.$a=function(b){b instanceof StorageEvent||"storage"!=b.type||(b=window.event);if(!("storageArea"in b))throw Error('"storageArea" property missing from event type: '+b.type);if(!("key"in b))throw Error('"key" property missing from event type: '+b.type);b.storageArea==this.m&&0==b.key.lastIndexOf(this.P,0)&&this.dispatchEvent("a")};var Bd=function(b,a){var d=b.m.getItem(b.P+"."+a);return null!=d?d:void 0},gb=function(){};gb.$b=function(){return gb.Kb?gb.Kb:gb.Kb=new gb};gb.prototype.send=
function(){return Ub()};var Ia=function(b,a){this.Xa=[];var d=z(function(){this.Ba=new nc(a.Ta());t(this.Xa,function(b){this.Ba.V(b)},this);this.Xa=null;return this.Ba},this);this.r=new fb(b,d,gb.$b())};Ia.prototype.Ta=function(){return this.r};Ia.prototype.V=function(b){this.Ba?this.Ba.V(b):this.Xa.push(b)};var $d=function(b,a){this.e=b;this.oc=a};$d.prototype.create=function(){return new Ia(this.e,this.oc)};var hb=function(b){bb.call(this);this.Va=b;this.b={}};H(hb,bb);var ae=[];hb.prototype.listen=
function(b,a,d,c){n(a)||(a&&(ae[0]=a.toString()),a=ae);for(var e=0;e<a.length;e++){var h=ld(b,a[e],d||this.handleEvent,c||!1,this.Va||this);if(!h)break;this.b[h.key]=h}return this};hb.prototype.cb=function(b,a,d,c){return uc(this,b,a,d,c)};var uc=function(b,a,d,c,e,h){if(n(d))for(var f=0;f<d.length;f++)uc(b,a,d[f],c,e,h);else{a=Oe(a,d,c||b.handleEvent,e,h||b.Va||b);if(!a)return b;b.b[a.key]=a}return b};hb.prototype.Wa=function(b,a,d,c,e){if(n(a))for(var h=0;h<a.length;h++)this.Wa(b,a[h],d,c,e);else d=
d||this.handleEvent,e=e||this.Va||this,d=ic(d),c=!!c,(a=ra(b)?b.aa(a,d,c,e):b?(b=Rb(b))?b.aa(a,d,c,e):null:null)&&(md(a),delete this.b[a.key]);return this};hb.prototype.removeAll=function(){$a(this.b,md);this.b={}};hb.prototype.l=function(){hb.K.l.call(this);this.removeAll()};hb.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};var D=function(){Z.call(this);this.ua=new hb(this);ja&&(jd?this.ua.listen(qe?document.body:window,["online","offline"],this.vb):(this.wb=
ja?navigator.onLine:!0,this.h=new Gb(250),this.ua.listen(this.h,"tick",this.cc),this.h.start()))};H(D,Z);D.prototype.cc=function(){var b=ja?navigator.onLine:!0;b!=this.wb&&(this.wb=b,this.vb())};D.prototype.vb=function(){this.dispatchEvent((ja?navigator.onLine:1)?"online":"offline")};D.prototype.l=function(){D.K.l.call(this);this.ua.$();this.ua=null;this.h&&(this.h.$(),this.h=null)};var Tc=function(b,a){this.e=b;this.g=a};Tc.prototype.send=function(b,a){a.set(Ha,ub(this.e));return this.g.send(b,a)};
var vc=function(b){this.g=b};vc.prototype.send=function(b,a){Yb(a);Ja(a);return this.g.send(b,a)};var Yb=function(b){mb(b,function(a,d){f(a.maxLength)&&"text"==a.valueType&&0<a.maxLength&&d.length>a.maxLength&&b.set(a,d.substring(0,a.maxLength))})},Ja=function(b){mb(b,function(a,d){f(a.defaultValue)&&d==a.defaultValue&&b.remove(a)})},Td={status:"device-offline",Ca:void 0},te={status:"rate-limited",Ca:void 0},ue={status:"sampled-out",Ca:void 0},ve={status:"sent",Ca:void 0},Cd=function(b,a){this.Zb=
b;this.g=a};Cd.prototype.send=function(b,a){var d;d=this.Zb;var c=d.rb(),e=Math.floor((c-d.qb)*d.Wb);0<e&&(d.da=Math.min(d.da+e,d.Xb),d.qb=c);1>d.da?d=!1:(--d.da,d=!0);return d||"item"==b||"transaction"==b?this.g.send(b,a):Ub(te)};var Ua=function(){this.da=60;this.Xb=500;this.Wb=5E-4;this.rb=function(){return(new Date).getTime()};this.qb=this.rb()},Va=function(b,a){this.e=b;this.g=a};Va.prototype.send=function(b,a){var d=a.get(Ha),d=parseInt(d.split("-")[1],16),c;"timing"!=b?c=Zd(this.e):((c=a.get(qc))&&
a.remove(qc),c=c||Zd(this.e));return d<655.36*c?this.g.send(b,a):Ub(ue)};var Zb=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/,wc=la,Uc=function(b,a){if(wc){wc=!1;var d=l.location;if(d){var c=d.href;if(c&&(c=(c=Uc(3,c))?decodeURI(c):c)&&c!=d.hostname)throw wc=!0,Error();}}return a.match(Zb)[b]||null},Dd=function(){};Dd.prototype.Gb=null;var $b=function(b){var a;(a=b.Gb)||(a={},Ed(b)&&(a[0]=!0,a[1]=!0),a=b.Gb=a);return a},Vc,Fd=function(){};
H(Fd,Dd);var Gd=function(b){return(b=Ed(b))?new ActiveXObject(b):new XMLHttpRequest},Ed=function(b){if(!b.Jb&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var a=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],d=0;d<a.length;d++){var c=a[d];try{return new ActiveXObject(c),b.Jb=c}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return b.Jb};Vc=new Fd;var Ba=function(b){Z.call(this);
this.headers=new ea;this.ja=b||null;this.G=!1;this.ga=this.a=null;this.fa=this.Ga="";this.J=this.Fa=this.ea=this.Ia=!1;this.ia=0;this.ha=null;this.eb="";this.Ha=this.Mb=!1};H(Ba,Z);var na=/^https?$/i,be=["POST","PUT"],Wc=[],Hd=function(b,a,d){var c=new Ba;Wc.push(c);a&&c.listen("complete",a);c.cb("ready",c.uc);c.send(b,"POST",d,void 0)};Ba.prototype.uc=function(){this.$();cc(Wc,this)};Ba.prototype.send=function(b,a,d,c){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+
this.Ga+"; newUri="+b);a=a?a.toUpperCase():"GET";this.Ga=b;this.fa="";this.Ia=!1;this.G=!0;this.a=this.ja?Gd(this.ja):Gd(Vc);this.ga=this.ja?$b(this.ja):$b(Vc);this.a.onreadystatechange=z(this.fb,this);try{this.Fa=!0,this.a.open(a,String(b),!0),this.Fa=!1}catch(e){this.ka(5,e);return}b=d||"";var h=this.headers.clone();c&&hd(c,function(b,a){h.set(a,b)});c=J(h.H());d=l.FormData&&b instanceof l.FormData;!(0<=ta(be,a))||c||d||h.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");h.forEach(function(b,
a){this.a.setRequestHeader(a,b)},this);this.eb&&(this.a.responseType=this.eb);"withCredentials"in this.a&&(this.a.withCredentials=this.Mb);try{Id(this),0<this.ia&&((this.Ha=ce(this.a))?(this.a.timeout=this.ia,this.a.ontimeout=z(this.gb,this)):this.ha=Sc(this.gb,this.ia,this)),this.ea=!0,this.a.send(b),this.ea=!1}catch(e){this.ka(5,e)}};var ce=function(b){return O&&I(9)&&p(b.timeout)&&f(b.ontimeout)},Pd=function(b){return"content-type"==b.toLowerCase()};Ba.prototype.gb=function(){"undefined"!=typeof k&&
this.a&&(this.fa="Timed out after "+this.ia+"ms, aborting",this.dispatchEvent("timeout"),this.abort(8))};Ba.prototype.ka=function(b,a){this.G=!1;this.a&&(this.J=!0,this.a.abort(),this.J=!1);this.fa=a;xc(this);yc(this)};var xc=function(b){b.Ia||(b.Ia=!0,b.dispatchEvent("complete"),b.dispatchEvent("error"))};Ba.prototype.abort=function(){this.a&&this.G&&(this.G=!1,this.J=!0,this.a.abort(),this.J=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),yc(this))};Ba.prototype.l=function(){this.a&&
(this.G&&(this.G=!1,this.J=!0,this.a.abort(),this.J=!1),yc(this,!0));Ba.K.l.call(this)};Ba.prototype.fb=function(){this.ba||(this.Fa||this.ea||this.J?de(this):this.lc())};Ba.prototype.lc=function(){de(this)};var de=function(b){if(b.G&&"undefined"!=typeof k&&(!b.ga[1]||4!=ac(b)||2!=Xc(b)))if(b.ea&&4==ac(b))Sc(b.fb,0,b);else if(b.dispatchEvent("readystatechange"),4==ac(b)){b.G=!1;try{var a=Xc(b),d,c;a:switch(a){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:c=!0;break a;default:c=!1}if(!(d=
c)){var e;if(e=0===a){var h=Uc(1,String(b.Ga));if(!h&&self.location)var f=self.location.protocol,h=f.substr(0,f.length-1);e=!na.test(h?h.toLowerCase():"")}d=e}if(d)b.dispatchEvent("complete"),b.dispatchEvent("success");else{var n;try{n=2<ac(b)?b.a.statusText:""}catch(l){n=""}b.fa=n+" ["+Xc(b)+"]";xc(b)}}finally{yc(b)}}},yc=function(b,d){if(b.a){Id(b);var c=b.a,e=b.ga[0]?a:null;b.a=null;b.ga=null;d||b.dispatchEvent("ready");try{c.onreadystatechange=e}catch(h){}}},Id=function(b){b.a&&b.Ha&&(b.a.ontimeout=
null);p(b.ha)&&(l.clearTimeout(b.ha),b.ha=null)},ac=function(b){return b.a?b.a.readyState:0},Xc=function(b){try{return 2<ac(b)?b.a.status:-1}catch(a){return-1}},Yc=function(b,a,d){this.v=b||null;this.pc=!!d},Ib=function(b){if(!b.c&&(b.c=new ea,b.j=0,b.v))for(var a=b.v.split("&"),d=0;d<a.length;d++){var c=a[d].indexOf("="),e=null,h=null;0<=c?(e=a[d].substring(0,c),h=a[d].substring(c+1)):e=a[d];e=decodeURIComponent(e.replace(/\+/g," "));e=Hb(b,e);b.add(e,h?decodeURIComponent(h.replace(/\+/g," ")):"")}};
c=Yc.prototype;c.c=null;c.j=null;c.add=function(b,a){Ib(this);this.v=null;b=Hb(this,b);var d=this.c.get(b);d||this.c.set(b,d=[]);d.push(a);this.j++;return this};c.remove=function(b){Ib(this);b=Hb(this,b);return this.c.R(b)?(this.v=null,this.j-=this.c.get(b).length,this.c.remove(b)):!1};c.R=function(b){Ib(this);b=Hb(this,b);return this.c.R(b)};c.H=function(){Ib(this);for(var b=this.c.w(),a=this.c.H(),d=[],c=0;c<a.length;c++)for(var e=b[c],h=0;h<e.length;h++)d.push(a[c]);return d};c.w=function(b){Ib(this);
var a=[];if(h(b))this.R(b)&&(a=wb(a,this.c.get(Hb(this,b))));else{b=this.c.w();for(var d=0;d<b.length;d++)a=wb(a,b[d])}return a};c.set=function(b,a){Ib(this);this.v=null;b=Hb(this,b);this.R(b)&&(this.j-=this.c.get(b).length);this.c.set(b,[a]);this.j++;return this};c.get=function(b,a){var d=b?this.w(b):[];return 0<d.length?String(d[0]):a};c.toString=function(){if(this.v)return this.v;if(!this.c)return"";for(var b=[],a=this.c.H(),d=0;d<a.length;d++)for(var c=a[d],e=encodeURIComponent(String(c)),c=this.w(c),
h=0;h<c.length;h++){var f=e;""!==c[h]&&(f+="="+encodeURIComponent(String(c[h])));b.push(f)}return this.v=b.join("&")};c.clone=function(){var b=new Yc;b.v=this.v;this.c&&(b.c=this.c.clone(),b.j=this.j);return b};var Hb=function(b,a){var d=String(a);b.pc&&(d=d.toLowerCase());return d},Jd=function(b,a){this.ac=b;this.oa=a};Jd.prototype.send=function(b,a){if(ja&&!navigator.onLine)return Ud();var d=new W,c=ee(b,a);c.length>this.oa?d.C({status:"payload-too-big",Ca:ua("Encoded hit length == %s, but should be <= %s.",
c.length,this.oa)}):Hd(this.ac,function(){d.t(ve)},c);return d};var ee=function(b,a){var d=new Yc;d.add(Cc.name,b);mb(a,function(b,a){d.add(b.name,a.toString())});return d.toString()},Zc=function(b,a,d){this.e=b;this.Tb=a;this.oa=d};Zc.prototype.Ta=function(){if(!this.r){if(!lc(this.e.Y).A)throw Error("Cannot construct shared channel prior to settings being ready.");new D;var b=new vc(new Jd(this.Tb,this.oa)),a=new Ua;this.r=new Tc(this.e,new Va(this.e,new Cd(a,b)))}return this.r};var C=new ea,Wa=
function(){if(!q){var b="chrome-extension:"==l.location.protocol?new Wb:new Xb;q=new ma(b)}return q};r("goog.async.Deferred",W);r("goog.async.Deferred.prototype.addCallback",W.prototype.N);r("goog.events.EventTarget",Z);r("goog.events.EventTarget.prototype.listen",Z.prototype.listen);r("analytics.getService",function(b,a){var d=C.get(b,null);if(null===d){if("chrome-extension:"==l.location.protocol)d=chrome.runtime.getManifest().version;else{if(!h(a)||/^[\s\xa0]*$/.test(a))throw Error("Invalid version. Must be non-empty string.");
d=a}var c=Wa();if(!jb){var e=Wa();jb=new $d(e,new Zc(e,"https://www.google-analytics.com/collect",8192))}d=new Fb("ca1.6.0prerelease",b,d,c,jb);C.set(b,d)}return d});r("analytics.internal.GoogleAnalyticsService",Fb);r("analytics.internal.GoogleAnalyticsService.prototype.getTracker",Fb.prototype.Dc);r("analytics.internal.GoogleAnalyticsService.prototype.getConfig",Fb.prototype.Cc);r("analytics.internal.ServiceSettings",ma);r("analytics.internal.ServiceSettings.prototype.setTrackingPermitted",ma.prototype.Mc);
r("analytics.internal.ServiceSettings.prototype.isTrackingPermitted",ma.prototype.ya);r("analytics.internal.ServiceSettings.prototype.setSampleRate",ma.prototype.Lc);r("analytics.internal.ServiceTracker",xa);r("analytics.internal.ServiceTracker.prototype.send",xa.prototype.send);r("analytics.internal.ServiceTracker.prototype.sendAppView",xa.prototype.Hc);r("analytics.internal.ServiceTracker.prototype.sendEvent",xa.prototype.Ic);r("analytics.internal.ServiceTracker.prototype.sendSocial",xa.prototype.Kc);
r("analytics.internal.ServiceTracker.prototype.sendException",xa.prototype.Jc);r("analytics.internal.ServiceTracker.prototype.sendTiming",xa.prototype.Eb);r("analytics.internal.ServiceTracker.prototype.startTiming",xa.prototype.Nc);r("analytics.internal.ServiceTracker.Timing",sc);r("analytics.internal.ServiceTracker.Timing.prototype.send",sc.prototype.send);r("analytics.internal.ServiceTracker.prototype.forceSessionStart",xa.prototype.Bc);r("analytics.internal.ServiceTracker.prototype.addFilter",
xa.prototype.V);r("analytics.internal.FilterChannel.Hit",sb);r("analytics.internal.FilterChannel.Hit.prototype.getHitType",sb.prototype.Ib);r("analytics.internal.FilterChannel.Hit.prototype.getParameters",sb.prototype.W);r("analytics.internal.FilterChannel.Hit.prototype.cancel",sb.prototype.cancel);r("analytics.ParameterMap",aa);r("analytics.ParameterMap.Entry",aa.Entry);r("analytics.ParameterMap.prototype.set",aa.prototype.set);r("analytics.ParameterMap.prototype.get",aa.prototype.get);r("analytics.ParameterMap.prototype.remove",
aa.prototype.remove);r("analytics.ParameterMap.prototype.toObject",aa.prototype.Lb);r("analytics.HitTypes.APPVIEW","appview");r("analytics.HitTypes.EVENT","event");r("analytics.HitTypes.SOCIAL","social");r("analytics.HitTypes.TRANSACTION","transaction");r("analytics.HitTypes.ITEM","item");r("analytics.HitTypes.TIMING","timing");r("analytics.HitTypes.EXCEPTION","exception");$a(Ec,function(b){var a=b.id.replace(/[A-Z]/,"_$&").toUpperCase();r("analytics.Parameters."+a,b)});r("analytics.filters.EventLabelerBuilder",
T);r("analytics.filters.EventLabelerBuilder.prototype.appendToExistingLabel",T.prototype.xc);r("analytics.filters.EventLabelerBuilder.prototype.stripValue",T.prototype.Oc);r("analytics.filters.EventLabelerBuilder.prototype.powersOfTwo",T.prototype.Fc);r("analytics.filters.EventLabelerBuilder.prototype.rangeBounds",T.prototype.Gc);r("analytics.filters.EventLabelerBuilder.prototype.build",T.prototype.Da);r("analytics.filters.FilterBuilder",La);r("analytics.filters.FilterBuilder.builder",Ic);r("analytics.filters.FilterBuilder.prototype.when",
La.prototype.when);r("analytics.filters.FilterBuilder.prototype.whenHitType",La.prototype.Ab);r("analytics.filters.FilterBuilder.prototype.whenValue",La.prototype.Pc);r("analytics.filters.FilterBuilder.prototype.applyFilter",La.prototype.zb);r("analytics.filters.FilterBuilder.prototype.build",La.prototype.Da);r("analytics.EventBuilder",V);r("analytics.EventBuilder.builder",function(){return id});r("analytics.EventBuilder.prototype.category",V.prototype.yc);r("analytics.EventBuilder.prototype.action",
V.prototype.action);r("analytics.EventBuilder.prototype.label",V.prototype.label);r("analytics.EventBuilder.prototype.value",V.prototype.value);r("analytics.EventBuilder.prototype.dimension",V.prototype.zc);r("analytics.EventBuilder.prototype.metric",V.prototype.Ec);r("analytics.EventBuilder.prototype.send",V.prototype.send)})();define("third_party/googleAnalytics/google-analytics-bundle",function(){});
(function(){function c(a,d){return a.set(d[0],d[1]),a}function k(a,d){return a.add(d),a}function l(a,d,c){switch(c.length){case 0:return a.call(d);case 1:return a.call(d,c[0]);case 2:return a.call(d,c[0],c[1]);case 3:return a.call(d,c[0],c[1],c[2])}return a.apply(d,c)}function f(a,d,c,e){for(var h=-1,f=a.length;++h<f;){var n=a[h];d(e,n,c(n),a)}return e}function a(a,d){for(var c=-1,e=a.length;++c<e&&!1!==d(a[c],c,a););return a}function e(a,d){for(var c=-1,e=a.length;++c<e;)if(!d(a[c],c,a))return!1;
return!0}function n(a,d){for(var c=-1,e=a.length,h=-1,f=[];++c<e;){var n=a[c];d(n,c,a)&&(f[++h]=n)}return f}function v(a,d){return!!a.length&&-1<r(a,d,0)}function h(a,d,c){for(var e=-1,h=a.length;++e<h;)if(c(d,a[e]))return!0;return!1}function p(a,d){for(var c=-1,e=a.length,h=Array(e);++c<e;)h[c]=d(a[c],c,a);return h}function y(a,d){for(var c=-1,e=d.length,h=a.length;++c<e;)a[h+c]=d[c];return a}function x(a,d,c,e){var h=-1,f=a.length;for(e&&f&&(c=a[++h]);++h<f;)c=d(c,a[h],h,a);return c}function N(a,
d,c,e){var h=a.length;for(e&&h&&(c=a[--h]);h--;)c=d(c,a[h],h,a);return c}function G(a,d){for(var c=-1,e=a.length;++c<e;)if(d(a[c],c,a))return!0;return!1}function z(a,d,c){for(var e=-1,h=a.length;++e<h;){var f=a[e],n=d(f);if(null!=n&&(k===q?n===n:c(n,k)))var k=n,l=f}return l}function A(a,d,c,e){var h;return c(a,function(a,c,f){return d(a,c,f)?(h=e?c:a,!1):void 0}),h}function E(a,d,c){for(var e=a.length,h=c?e:-1;c?h--:++h<e;)if(d(a[h],h,a))return h;return-1}function r(a,d,c){if(d!==d)return Lb(a,c);
--c;for(var e=a.length;++c<e;)if(a[c]===d)return c;return-1}function H(a,d,c,e,h){return h(a,function(a,h,f){c=e?(e=!1,a):d(c,a,h,f)}),c}function Q(a,d){var c=a.length;for(a.sort(d);c--;)a[c]=a[c].c;return a}function ca(a,d){for(var c,e=-1,h=a.length;++e<h;){var f=d(a[e]);f!==q&&(c=c===q?f:c+f)}return c}function da(a,d){for(var c=-1,e=Array(a);++c<a;)e[c]=d(c);return e}function F(a,d){return p(d,function(d){return[d,a[d]]})}function ta(a){return function(d){return a(d)}}function t(a,d){return p(d,
function(d){return a[d]})}function U(a,d){for(var c=-1,e=a.length;++c<e&&-1<r(d,a[c],0););return c}function S(a,d){for(var c=a.length;c--&&-1<r(d,a[c],0););return c}function J(a){return a&&a.Object===Object?a:null}function cc(a,d){if(a!==d){var c=null===a,e=a===q,h=a===a,f=null===d,n=d===q,k=d===d;if(a>d&&!f||!h||c&&!n&&k||e&&k)return 1;if(d>a&&!c||!k||f&&!e&&h||n&&h)return-1}return 0}function wb(a){return cb[a]}function ed(a){return ia[a]}function dc(a){return"\\"+jd[a]}function Lb(a,d,c){var e=
a.length;for(d+=c?0:-1;c?d--:++d<e;){var h=a[d];if(h!==h)return d}return-1}function $a(a){var d=!1;if(null!=a&&"function"!=typeof a.toString)try{d=!!(a+"")}catch(c){}return d}function Ca(a,d){return a="number"==typeof a||qa.test(a)?+a:-1,-1<a&&0==a%1&&(null==d?9007199254740991:d)>a}function xb(a){for(var d,c=[];!(d=a.next()).done;)c.push(d.value);return c}function ec(a){var d=-1,c=Array(a.size);return a.forEach(function(a,e){c[++d]=[e,a]}),c}function Da(a,d){for(var c=-1,e=a.length,h=-1,f=[];++c<
e;){var n=a[c];(n===d||"__lodash_placeholder__"===n)&&(a[c]="__lodash_placeholder__",f[++h]=c)}return f}function Mb(a){var d=-1,c=Array(a.size);return a.forEach(function(a){c[++d]=a}),c}function ea(a){if(!a||!Y.test(a))return a.length;for(var d=O.lastIndex=0;O.test(a);)d++;return d}function yb(a){return Oa[a]}function ab(J){function d(g){if(ha(g)&&!L(g)&&!(g instanceof K)){if(g instanceof ia)return g;if(fa.call(g,"__wrapped__"))return Fd(g)}return new ia(g)}function cb(){}function ia(g,u){this.__wrapped__=
g;this.__actions__=[];this.__chain__=!!u;this.__index__=0;this.__values__=q}function K(g){this.__wrapped__=g;this.__actions__=[];this.__dir__=1;this.__filtered__=!1;this.__iteratees__=[];this.__takeCount__=4294967295;this.__views__=[]}function ja(){}function Oa(g){var u=-1,a=g?g.length:0;for(this.clear();++u<a;){var b=g[u];this.set(b[0],b[1])}}function qa(g){var u=-1,a=g?g.length:0;for(this.__data__=new Oa;++u<a;)this.push(g[u])}function ra(g,u){var a=g.__data__;return Zb(u)?(a=a.__data__,"__lodash_hash_undefined__"===
("string"==typeof u?a.string:a.hash)[u]):a.has(u)}function Qa(g){var u=-1,a=g?g.length:0;for(this.clear();++u<a;){var b=g[u];this.set(b[0],b[1])}}function za(g,u){var a=Fa(g,u);return 0>a?!1:(a==g.length-1?g.pop():fe.call(g,a,1),!0)}function db(g,u){var a=Fa(g,u);return 0>a?q:g[a][1]}function Fa(g,u){for(var a=g.length;a--;)if(Wa(g[a][0],u))return a;return-1}function Rb(g,u,a){var b=Fa(g,u);0>b?g.push([u,a]):g[b][1]=a}function jc(g,u,a,b){return g===q||Wa(g,$c[a])&&!fa.call(b,a)?u:g}function ic(g,
u,a){(a===q||Wa(g[u],a))&&("number"!=typeof u||a!==q||u in g)||(g[u]=a)}function Z(g,u,a){var b=g[u];fa.call(g,u)&&Wa(b,a)&&(a!==q||u in g)||(g[u]=a)}function Kc(g,u,a,b){return Jb(g,function(g,d,c){u(b,g,a(g),c)}),b}function nd(g,u){return g&&fb(u,sa(u),g)}function kc(g,u){for(var a=-1,b=null==g,d=u.length,c=Array(d);++a<d;)c[a]=b?q:Kd(g,u[a]);return c}function od(g){return ga(g)?g:[]}function Sa(g){return"function"==typeof g?g:ib}function Ra(g){return L(g)?g:Vc(g)}function Sb(g,u,a){return g===
g&&(a!==q&&(g=g>a?a:g),u!==q&&(g=u>g?u:g)),g}function wa(g,u,b,d,c,e){var h;if(b&&(h=c?b(g,d,c,e):b(g)),h!==q)return h;if(!X(g))return g;if(d=L(g)){if(h=te(g),!u)return ka(g,h)}else{var f=Ja(g),n="[object Function]"==f||"[object GeneratorFunction]"==f;if(Se(g))return Wd(g,u);if("[object Object]"==f||"[object Arguments]"==f||n&&!c){if($a(g))return c?g:{};if(h=ue(n?{}:g),!u)return Vb(g,nd(h,g))}else{if(!B[f])return c?g:{};h=ve(g,f,u)}}return e||(e=new Qa),(c=e.get(g))?c:(e.set(g,h),(d?a:Ga)(g,function(a,
d){Z(h,d,wa(a,u,b,d,g,e))}),d?h:Vb(g,h))}function Lc(g){var u=sa(g),a=u.length;return function(b){if(null==b)return!a;for(var d=a;d--;){var c=u[d],e=g[c],h=b[c];if(h===q&&!(c in Object(b))||!e(h))return!1}return!0}}function Bb(g){return X(g)?zf(g):{}}function Rd(g,u,a){if("function"!=typeof g)throw new Xa("Expected a function");return ge(function(){g.apply(q,a)},u)}function ob(g,u,a,b){var d=-1,c=v,e=!0,f=g.length,n=[],m=u.length;if(!f)return n;a&&(u=p(u,ta(a)));b?(c=h,e=!1):200<=u.length&&(c=ra,
e=!1,u=new qa(u));a:for(;++d<f;){var k=g[d],l=a?a(k):k;if(e&&l===l){for(var t=m;t--;)if(u[t]===l)continue a;n.push(k)}else c(u,l,b)||n.push(k)}return n}function Sd(g,u){var a=!0;return Jb(g,function(g,b,d){return a=!!u(g,b,d)}),a}function eb(g,u){var a=[];return Jb(g,function(g,b,d){u(g,b,d)&&a.push(g)}),a}function R(g,u,a,b){b||(b=[]);for(var d=-1,c=g.length;++d<c;){var e=g[d];0<u&&ga(e)&&(a||L(e)||m(e))?1<u?R(e,u-1,a,b):y(b,e):a||(b[b.length]=e)}return b}function jd(g,u){return null==g?g:we(g,u,
Ya)}function Ga(g,u){return g&&we(g,u,sa)}function pb(g,u){return g&&Te(g,u,sa)}function Nc(g,u){return n(u,function(u){return Ka(g[u])})}function Mc(g,u){u=Va(u,g)?[u+""]:Ra(u);for(var a=0,b=u.length;null!=g&&b>a;)g=g[u[a++]];return a&&a==b?g:q}function pd(g,a){return fa.call(g,a)||"object"==typeof g&&a in g&&null===he(g)}function kd(g,a){return a in Object(g)}function Cb(g,a,b){for(var d=b?h:v,c=g.length,e=c,f=Array(c),n=[];e--;){var m=g[e];e&&a&&(m=p(m,ta(a)));f[e]=b||!a&&120>m.length?q:new qa(e&&
m)}var m=g[0],k=-1,l=m.length,t=f[0];a:for(;++k<l;){var B=m[k],r=a?a(B):B;if(t?!ra(t,r):!d(n,r,b)){for(e=c;--e;){var S=f[e];if(S?!ra(S,r):!d(g[e],r,b))continue a}t&&t.push(r);n.push(B)}}return n}function W(g,a,b,d){return Ga(g,function(g,c,e){a(d,b(g),c,e)}),d}function Db(g,a,b){return Va(a,g)||(a=Ra(a),g=$b(g,a),a=na(a)),a=null==g?g:g[a],null==a?q:l(a,g,b)}function qb(g,a,b,d,c){if(g===a)return!0;if(null==g||null==a||!X(g)&&!ha(a))return g!==g&&a!==a;var e=L(g),h=L(a),f="[object Array]",n="[object Array]";
e||(f=Ja(g),"[object Arguments]"==f?f="[object Object]":"[object Object]"!=f&&(e=ad(g)));h||(n=Ja(a),"[object Arguments]"==n?n="[object Object]":"[object Object]"!=n&&ad(a));var m="[object Object]"==f&&!$a(g),h="[object Object]"==n&&!$a(a),n=f==n;!n||e||m?2&d||(f=m&&fa.call(g,"__wrapped__"),h=h&&fa.call(a,"__wrapped__"),!f&&!h)?n?(c||(c=new Qa),g=(e?$d:ae)(g,a,qb,b,d,c)):g=!1:g=qb(f?g.value():g,h?a.value():a,b,d,c):g=hb(g,a,f,qb,b,d);return g}function rb(g,a,b,d){var c=b.length,e=c,h=!d;if(null==
g)return!e;for(g=Object(g);c--;){var f=b[c];if(h&&f[2]?f[1]!==g[f[0]]:!(f[0]in g))return!1}for(;++c<e;){var f=b[c],n=f[0],m=g[n],k=f[1];if(h&&f[2]){if(m===q&&!(n in g))return!1}else if(f=new Qa,n=d?d(m,k,n,g,a,f):q,n===q?!qb(k,m,d,3,f):!n)return!1}return!0}function lc(g){var a=typeof g;return"function"==a?g:null==g?ib:"object"==a?L(g)?Ud(g[0],g[1]):Ub(g):Ue(g)}function rd(g){g=null==g?g:Object(g);var a,b=[];for(a in g)b.push(a);return b}function qd(g,a){var b=-1,d=w(g)?Array(g.length):[];return Jb(g,
function(g,c,e){d[++b]=a(g,c,e)}),d}function Ub(g){var a=Tc(g);if(1==a.length&&a[0][2]){var b=a[0][0],d=a[0][1];return function(g){return null==g?!1:g[b]===d&&(d!==q||b in Object(g))}}return function(b){return b===g||rb(b,g,a)}}function Ud(g,a){return function(b){var d=Kd(b,g);return d===q&&d===a?Ve(b,g):qb(a,d,q,3)}}function Eb(g,b,d,c,e){if(g!==b){var h=L(b)||ad(b)?q:Ya(b);a(h||b,function(a,f){if(h&&(f=a,a=b[f]),X(a)){e||(e=new Qa);var n=f,k=e,l=g[n],t=b[n],p=k.get(t);if(!p){var p=c?c(l,t,n+"",
g,b,k):q,B=p===q;B&&(p=t,L(t)||ad(t)?L(l)?p=l:ga(l)?p=ka(l):(B=!1,p=wa(t,!0)):pe(t)||m(t)?m(l)?p=We(l):!X(l)||d&&Ka(l)?(B=!1,p=wa(t,!0)):p=l:B=!1);k.set(t,p);B&&Eb(p,t,d,c,k)}ic(g,n,p)}else n=c?c(g[f],a,f+"",g,b,e):q,n===q&&(n=a),ic(g,f,n)})}}function Tb(g,a,b){var d=-1,c=D();return a=p(a.length?a:Array(1),function(g){return c(g)}),g=qd(g,function(g,b,c){return{a:p(a,function(a){return a(g)}),b:++d,c:g}}),Q(g,function(g,a){var u;a:{u=-1;for(var d=g.a,c=a.a,e=d.length,h=b.length;++u<e;){var f=cc(d[u],
c[u]);if(f){if(u>=h){u=f;break a}u=f*("desc"==b[u]?-1:1);break a}}u=g.b-a.b}return u})}function sd(g,a){return g=Object(g),x(a,function(a,b){return b in g&&(a[b]=g[b]),a},{})}function mc(g,a){var b={};return jd(g,function(g,d){a(g,d)&&(b[d]=g)}),b}function nc(g){return function(a){return null==a?q:a[g]}}function sb(g){return function(a){return Mc(a,g)}}function oc(g,a,b){var d=-1,c=a.length,e=g;for(b&&(e=p(g,function(g){return b(g)}));++d<c;)for(var h=0,f=a[d],f=b?b(f):f;-1<(h=r(e,f,h));)e!==g&&fe.call(e,
h,1),fe.call(g,h,1);return g}function td(g,a){for(var b=g?a.length:0,d=b-1;b--;){var c=a[b];if(d==b||c!=e){var e=c;if(Ca(c))fe.call(g,c,1);else if(Va(c,g))delete g[c];else{var c=Ra(c),h=$b(g,c);null!=h&&delete h[na(c)]}}}return g}function Oc(g,a){return g+ie(Xe()*(a-g+1))}function Pc(g,a,b,d){a=Va(a,g)?[a+""]:Ra(a);for(var c=-1,e=a.length,h=e-1,f=g;null!=f&&++c<e;){var n=a[c];if(X(f)){var m=b;if(c!=h){var k=f[n],m=d?d(k,n,f):q;m===q&&(m=null==k?Ca(a[c+1])?[]:{}:k)}Z(f,n,m)}f=f[n]}return g}function Ha(g,
a,b){var d=-1,c=g.length;0>a&&(a=-a>c?0:c+a);b=b>c?c:b;0>b&&(b+=c);c=a>b?0:b-a>>>0;a>>>=0;for(b=Array(c);++d<c;)b[d]=g[d+a];return b}function Vd(g,a){var b;return Jb(g,function(g,d,c){return b=a(g,d,c),!b}),!!b}function pc(g,a,b){var d=0,c=g?g.length:d;if("number"==typeof a&&a===a&&2147483647>=c){for(;c>d;){var e=d+c>>>1,h=g[e];(b?a>=h:a>h)&&null!==h?d=e+1:c=e}return c}return qc(g,a,ib,b)}function qc(g,a,b,d){a=b(a);for(var c=0,e=g?g.length:0,h=a!==a,f=null===a,n=a===q;e>c;){var m=ie((c+e)/2),k=b(g[m]),
l=k!==q,t=k===k;(h?t||d:f?t&&l&&(d||null!=k):n?t&&(d||l):null==k?0:d?a>=k:a>k)?c=m+1:e=m}return Za(e,4294967294)}function ud(g,a){for(var b=0,d=g.length,c=g[0],e=a?a(c):c,h=e,f=0,n=[c];++b<d;)c=g[b],e=a?a(c):c,Wa(e,h)||(h=e,n[++f]=c);return n}function tb(g,a,b){var d=-1,c=v,e=g.length,f=!0,n=[],m=n;if(b)f=!1,c=h;else if(200>e)m=a?[]:n;else{if(c=a?null:Af(g))return Mb(c);f=!1;c=ra;m=new qa}a:for(;++d<e;){var k=g[d],l=a?a(k):k;if(f&&l===l){for(var t=m.length;t--;)if(m[t]===l)continue a;a&&m.push(l);
n.push(k)}else c(m,l,b)||(m!==n&&m.push(l),n.push(k))}return n}function rc(g,a,b,d){for(var c=g.length,e=d?c:-1;(d?e--:++e<c)&&a(g[e],e,g););return b?Ha(g,d?0:e,d?e+1:c):Ha(g,d?e+1:0,d?c:e)}function vd(g,a){var b=g;return b instanceof K&&(b=b.value()),x(a,function(g,a){return a.func.apply(a.thisArg,y([g],a.args))},b)}function wd(g,a,b){for(var d=-1,c=g.length;++d<c;)var e=e?y(ob(e,g[d],a,b),ob(g[d],e,a,b)):g[d];return e&&e.length?tb(e,a,b):[]}function xd(g,a,b){for(var d=-1,c=g.length,e=a.length,
h={};++d<c;)b(h,g[d],e>d?a[d]:q);return h}function Wd(g,a){if(a)return g.slice();var b=new g.constructor(g.length);return g.copy(b),b}function xa(g){var a=new g.constructor(g.byteLength);return(new je(a)).set(new je(g)),a}function sc(g,a,b,d){var c=-1,e=g.length,h=b.length,f=-1,n=a.length,m=oa(e-h,0),k=Array(n+m);for(d=!d;++f<n;)k[f]=a[f];for(;++c<h;)(d||e>c)&&(k[b[c]]=g[c]);for(;m--;)k[f++]=g[c++];return k}function Fb(g,a,b,d){var c=-1,e=g.length,h=-1,f=b.length,n=-1,m=a.length,k=oa(e-f,0),l=Array(k+
m);for(d=!d;++c<k;)l[c]=g[c];for(k=c;++n<m;)l[k+n]=a[n];for(;++h<f;)(d||e>c)&&(l[k+b[h]]=g[c++]);return l}function ka(g,a){var b=-1,d=g.length;for(a||(a=Array(d));++b<d;)a[b]=g[b];return a}function fb(g,a,b){return Qc(g,a,b)}function Qc(g,a,b,d){b||(b={});for(var c=-1,e=a.length;++c<e;){var h=a[c],f=d?d(b[h],g[h],h,b,g):g[h];Z(b,h,f)}return b}function Vb(g,a){return fb(g,Bf(g),a)}function Rc(g,a){return function(b,d){var c=L(b)?f:Kc,e=a?a():{};return c(b,g,D(d),e)}}function ma(g){return C(function(a,
b){var d=-1,c=b.length,e=1<c?b[c-1]:q,h=2<c?b[2]:q,e="function"==typeof e?(c--,e):q;h&&Ua(b[0],b[1],h)&&(e=3>c?q:e,c=1);for(a=Object(a);++d<c;)(h=b[d])&&g(a,h,d,e);return a})}function Xd(g,a){return function(b,d){if(null==b)return b;if(!w(b))return g(b,d);for(var c=b.length,e=a?c:-1,h=Object(b);(a?e--:++e<c)&&!1!==d(h[e],e,h););return b}}function yd(g){return function(a,b,d){var c=-1,e=Object(a);d=d(a);for(var h=d.length;h--;){var f=d[g?h:++c];if(!1===b(e[f],f,e))break}return a}}function se(g,a,b){function d(){return(this&&
this!==Aa&&this instanceof d?e:g).apply(c?b:this,arguments)}var c=1&a,e=tc(g);return d}function Yd(g){return function(a){a=P(a);var b=Y.test(a)?a.match(O):q,d=b?b[0]:a.charAt(0);return a=b?b.slice(1).join(""):a.slice(1),d[g]()+a}}function ub(g){return function(a){return x(Ye(Ze(a)),g,"")}}function tc(g){return function(){var a=arguments;switch(a.length){case 0:return new g;case 1:return new g(a[0]);case 2:return new g(a[0],a[1]);case 3:return new g(a[0],a[1],a[2]);case 4:return new g(a[0],a[1],a[2],
a[3]);case 5:return new g(a[0],a[1],a[2],a[3],a[4]);case 6:return new g(a[0],a[1],a[2],a[3],a[4],a[5]);case 7:return new g(a[0],a[1],a[2],a[3],a[4],a[5],a[6])}var b=Bb(g.prototype),a=g.apply(b,a);return X(a)?a:b}}function Zd(g,a,b){function d(){for(var e=arguments.length,h=Array(e),f=e,n=Yb(d);f--;)h[f]=arguments[f];return f=3>e&&h[0]!==n&&h[e-1]!==n?[]:Da(h,n),e-=f.length,b>e?Bd(g,a,Ta,d.placeholder,q,h,f,q,q,b-e):l(this&&this!==Aa&&this instanceof d?c:g,this,h)}var c=tc(g);return d}function zd(g){return C(function(a){a=
R(a,1);var b=a.length,d=b,c=ia.prototype.thru;for(g&&a.reverse();d--;){var e=a[d];if("function"!=typeof e)throw new Xa("Expected a function");if(c&&!h&&"wrapper"==uc(e))var h=new ia([],!0)}for(d=h?d:b;++d<b;)var e=a[d],c=uc(e),f="wrapper"==c?xe(e):q,h=f&&wc(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?h[uc(f[0])].apply(h,f[3]):1==e.length&&wc(e)?h[c]():h.thru(e);return function(){var g=arguments,d=g[0];if(h&&1==g.length&&L(d)&&200<=d.length)return h.plant(d).value();for(var c=0,g=b?a[c].apply(this,g):
d;++c<b;)g=a[c].call(this,g);return g}})}function Ta(g,a,b,d,c,e,h,f,n,m){function k(){for(var S=arguments.length,y=S,x=Array(S);y--;)x[y]=arguments[y];if(B){var U,J=Yb(k),y=x.length;for(U=0;y--;)x[y]===J&&U++}if(d&&(x=sc(x,d,c,B)),e&&(x=Fb(x,e,h,B)),S-=U,B&&m>S)return J=Da(x,J),Bd(g,a,Ta,k.placeholder,b,x,J,f,n,m-S);if(J=t?b:this,y=p?J[g]:g,S=x.length,f){U=x.length;for(var H=Za(f.length,U),cb=ka(x);H--;){var z=f[H];x[H]=Ca(z,U)?cb[z]:q}}else v&&1<S&&x.reverse();return l&&S>n&&(x.length=n),this&&
this!==Aa&&this instanceof k&&(y=r||tc(y)),y.apply(J,x)}var l=128&a,t=1&a,p=2&a,B=24&a,v=512&a,r=p?q:tc(g);return k}function Wb(g,a){return function(b,d){return W(b,g,a(d),{})}}function Ad(g){return C(function(a){return a=p(R(a,1),D()),C(function(b){var d=this;return g(a,function(g){return l(g,d,b)})})})}function Gb(g,a,b){return a=M(a),g=ea(g),a&&a>g?(a-=g,b=b===q?" ":b+"",g=$e(b,ke(a/ea(b))),Y.test(b)?g.match(O).slice(0,a).join(""):g.slice(0,a)):""}function Sc(g,a,b,d){function c(){for(var a=-1,
u=arguments.length,f=-1,n=d.length,k=Array(n+u),m=this&&this!==Aa&&this instanceof c?h:g;++f<n;)k[f]=d[f];for(;u--;)k[f++]=arguments[++a];return l(m,e?b:this,k)}var e=1&a,h=tc(g);return c}function Xb(g){return function(a,b,d){d&&"number"!=typeof d&&Ua(a,b,d)&&(b=d=q);a=pa(a);a=a===a?a:0;b===q?(b=a,a=0):b=pa(b)||0;d=d===q?b>a?1:-1:pa(d)||0;var c=-1;b=oa(ke((b-a)/(d||1)),0);for(var e=Array(b);b--;)e[g?b:++c]=a,a+=d;return e}}function Bd(g,a,b,d,c,e,h,f,n,k){var m=8&a;f=f?ka(f):q;var l=m?h:q;h=m?q:h;
var t=m?e:q;return e=m?q:e,a=(a|(m?32:64))&~(m?64:32),4&a||(a&=-4),a=[g,a,c,t,l,e,h,f,n,k],b=b.apply(q,a),wc(g)&&af(b,a),b.placeholder=d,b}function gb(g){var a=bd[g];return function(g,b){if(g=pa(g),b=M(b)){var d=(P(g)+"e").split("e"),d=a(d[0]+"e"+(+d[1]+b)),d=(P(d)+"e").split("e");return+(d[0]+"e"+(+d[1]-b))}return a(g)}}function Ia(g,a,b,d,c,e,h,f){var n=2&a;if(!n&&"function"!=typeof g)throw new Xa("Expected a function");var m=d?d.length:0;if(m||(a&=-97,d=c=q),h=h===q?h:oa(M(h),0),f=f===q?f:M(f),
m-=c?c.length:0,64&a){var k=d,l=c;d=c=q}var t=n?q:xe(g);return e=[g,a,b,d,c,k,l,e,h,f],t&&(b=e[1],g=t[1],a=b|g,d=128==g&&8==b||128==g&&256==b&&t[8]>=e[7].length||384==g&&t[8]>=t[7].length&&8==b,131>a||d)&&(1&g&&(e[2]=t[2],a|=1&b?0:4),(b=t[3])&&(d=e[3],e[3]=d?sc(d,b,t[4]):ka(b),e[4]=d?Da(e[3],"__lodash_placeholder__"):ka(t[4])),(b=t[5])&&(d=e[5],e[5]=d?Fb(d,b,t[6]):ka(b),e[6]=d?Da(e[5],"__lodash_placeholder__"):ka(t[6])),(b=t[7])&&(e[7]=ka(b)),128&g&&(e[8]=null==e[8]?t[8]:Za(e[8],t[8])),null==e[9]&&
(e[9]=t[9]),e[0]=t[0],e[1]=a),g=e[0],a=e[1],b=e[2],d=e[3],c=e[4],f=e[9]=null==e[9]?n?0:g.length:oa(e[9]-m,0),!f&&24&a&&(a&=-25),n=a&&1!=a?8==a||16==a?Zd(g,a,f):32!=a&&33!=a||c.length?Ta.apply(q,e):Sc(g,a,b,d):se(g,a,b),(t?bf:af)(n,e)}function $d(g,a,b,d,c,e){var h=-1,f=2&c,n=1&c,m=g.length,k=a.length;if(!(m==k||f&&k>m))return!1;if(k=e.get(g))return k==a;k=!0;for(e.set(g,a);++h<m;){var t=g[h],l=a[h];if(d)var p=f?d(l,t,h,a,g,e):d(t,l,h,g,a,e);if(p!==q){if(p)continue;k=!1;break}if(n){if(!G(a,function(g){return t===
g||b(t,g,d,c,e)})){k=!1;break}}else if(t!==l&&!b(t,l,d,c,e)){k=!1;break}}return e["delete"](g),k}function hb(g,a,b,d,c,e){switch(b){case "[object ArrayBuffer]":if(g.byteLength!=a.byteLength||!d(new je(g),new je(a)))break;return!0;case "[object Boolean]":case "[object Date]":return+g==+a;case "[object Error]":return g.name==a.name&&g.message==a.message;case "[object Number]":return g!=+g?a!=+a:g==+a;case "[object RegExp]":case "[object String]":return g==a+"";case "[object Map]":var h=ec;case "[object Set]":return h||
(h=Mb),(2&e||g.size==a.size)&&d(h(g),h(a),c,1|e);case "[object Symbol]":return!!Kb&&ye.call(g)==ye.call(a)}return!1}function ae(g,a,b,d,c,e){var h=2&c,f=sa(g),n=f.length,k=sa(a).length;if(n!=k&&!h)return!1;for(var m=n;m--;){var t=f[m];if(!(h?t in a:pd(a,t)))return!1}if(k=e.get(g))return k==a;k=!0;e.set(g,a);for(var l=h;++m<n;){var t=f[m],p=g[t],B=a[t];if(d)var v=h?d(B,p,t,a,g,e):d(p,B,t,g,a,e);if(v===q?p!==B&&!b(p,B,d,c,e):!v){k=!1;break}l||(l="constructor"==t)}return k&&!l&&(b=g.constructor,d=a.constructor,
b!=d&&"constructor"in g&&"constructor"in a&&!("function"==typeof b&&b instanceof b&&"function"==typeof d&&d instanceof d)&&(k=!1)),e["delete"](g),k}function uc(g){for(var a=g.name+"",b=Ld[a],d=fa.call(Ld,a)?b.length:0;d--;){var c=b[d],e=c.func;if(null==e||e==g)return c.name}return a}function D(){var g=d.iteratee||ze,g=g===ze?lc:g;return arguments.length?g(arguments[0],arguments[1]):g}function Tc(g){g=cf(g);for(var a=g.length;a--;){var b,d=g[a];b=g[a][1];b=b===b&&!X(b);d[2]=b}return g}function vc(g,
a){var b=null==g?q:g[a];return Le(b)?b:q}function Yb(g){return(fa.call(d,"placeholder")?d:g).placeholder}function Ja(g){return ya.call(g)}function Td(g,a,b){if(null==g)return!1;var d=b(g,a);return d||Va(a)||(a=Ra(a),g=$b(g,a),null!=g&&(a=na(a),d=b(g,a))),b=g?g.length:q,d||!!b&&fd(b)&&Ca(a,b)&&(L(g)||zc(g)||m(g))}function te(g){var a=g.length,b=g.constructor(a);return a&&"string"==typeof g[0]&&fa.call(g,"index")&&(b.index=g.index,b.input=g.input),b}function ue(g){return Ka(g.constructor)&&!Uc(g)?Bb(he(g)):
{}}function ve(g,a,b){var d=g.constructor;switch(a){case "[object ArrayBuffer]":return xa(g);case "[object Boolean]":case "[object Date]":return new d(+g);case "[object Float32Array]":case "[object Float64Array]":case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return a=g.buffer,b=b?xa(a):a,new g.constructor(b,g.byteOffset,g.length);case "[object Map]":return b=
g.constructor,x(ec(g),c,new b);case "[object Number]":case "[object String]":return new d(g);case "[object RegExp]":return b=new g.constructor(g.source,mb.exec(g)),b.lastIndex=g.lastIndex,b;case "[object Set]":return b=g.constructor,x(Mb(g),k,new b);case "[object Symbol]":return Kb?Object(ye.call(g)):{}}}function Cd(g){var a=g?g.length:q;return fd(a)&&(L(g)||zc(g)||m(g))?da(a,String):null}function Ua(g,a,b){if(!X(b))return!1;var d=typeof a;return("number"==d?w(b)&&Ca(a,b.length):"string"==d&&a in
b)?Wa(b[a],g):!1}function Va(g,a){return"number"==typeof g?!0:!L(g)&&(La.test(g)||!gd.test(g)||null!=a&&g in Object(a))}function Zb(g){var a=typeof g;return"number"==a||"boolean"==a||"string"==a&&"__proto__"!=g||null==g}function wc(g){var a=uc(g),b=d[a];return"function"==typeof b&&a in K.prototype?g===b?!0:(a=xe(b),!!a&&g===a[0]):!1}function Uc(g){var a=g&&g.constructor,a=Ka(a)&&a.prototype||$c;return g===a}function Dd(g,a,b,d,c,e){return X(g)&&X(a)&&(e.set(a,g),Eb(g,a,q,Dd,e)),g}function $b(g,a){return 1==
a.length?g:Kd(g,Ha(a,0,-1))}function Vc(g){var a=[];return P(g).replace(Ic,function(g,b,d,c){a.push(d?c.replace(hd,"$1"):b||g)}),a}function Fd(g){if(g instanceof K)return g.clone();var a=new ia(g.__wrapped__,g.__chain__);return a.__actions__=ka(g.__actions__),a.__index__=g.__index__,a.__values__=g.__values__,a}function Gd(g,a,b){var d=g?g.length:0;return d?(a=b||a===q?1:M(a),Ha(g,0>a?0:a,d)):[]}function Ed(g,a,b){var d=g?g.length:0;return d?(a=b||a===q?1:M(a),a=d-a,Ha(g,0,0>a?0:a)):[]}function Ba(g){return g?
g[0]:q}function na(g){var a=g?g.length:0;return a?g[a-1]:q}function be(g,a){return g&&g.length&&a&&a.length?oc(g,a):g}function Wc(g){return g?Cf.call(g):g}function Hd(g){if(!g||!g.length)return[];var a=0;return g=n(g,function(g){return ga(g)?(a=oa(g.length,a),!0):void 0}),da(a,function(a){return p(g,nc(a))})}function ce(g,a){if(!g||!g.length)return[];var b=Hd(g);return null==a?b:p(b,function(g){return l(a,q,g)})}function Pd(g){return g=d(g),g.__chain__=!0,g}function xc(g,a){return a(g)}function de(){return this}
function yc(g,b){return"function"==typeof b&&L(g)?a(g,b):Jb(g,Sa(b))}function Id(g,a){var b;if("function"==typeof a&&L(g)){for(b=g.length;b--&&!1!==a(g[b],b,g););b=g}else b=Ae(g,Sa(a));return b}function ac(g,a){return(L(g)?p:qd)(g,D(a,3))}function Xc(g,a){var b=-1,d=Be(g),c=d.length,e=c-1;for(a=Sb(M(a),0,c);++b<a;){var c=Oc(b,e),h=d[c];d[c]=d[b];d[b]=h}return d.length=a,d}function Yc(g,a,b){return a=b?q:a,a=g&&null==a?g.length:a,Ia(g,128,q,q,q,q,a)}function Ib(g,a){var b;if("function"!=typeof a)throw new Xa("Expected a function");
return g=M(g),function(){return 0<--g&&(b=a.apply(this,arguments)),1>=g&&(a=q),b}}function Hb(g,a,b){return a=b?q:a,g=Ia(g,8,q,q,q,q,q,a),g.placeholder=Hb.placeholder,g}function Jd(g,a,b){return a=b?q:a,g=Ia(g,16,q,q,q,q,q,a),g.placeholder=Jd.placeholder,g}function ee(g,a,b){function d(){p&&Md(p);k&&Md(k);v=0;n=k=l=p=B=q}function c(a,b){b&&Md(b);k=p=B=q;a&&(v=Nd(),m=g.apply(l,n),p||k||(n=l=q))}function e(){var g=a-(Nd()-t);0>=g||g>a?c(B,k):p=ge(e,g)}function h(){c(r,p)}function f(){if(n=arguments,
t=Nd(),l=this,B=r&&(p||!S),!1===y)var b=S&&!p;else{v||k||S||(v=t);var d=y-(t-v),c=(0>=d||d>y)&&(S||k);c?(k&&(k=Md(k)),v=t,m=g.apply(l,n)):k||(k=ge(h,d))}return c&&p?p=Md(p):p||a===y||(p=ge(e,a)),b&&(c=!0,m=g.apply(l,n)),!c||p||k||(n=l=q),m}var n,k,m,t,l,p,B,v=0,S=!1,y=!1,r=!0;if("function"!=typeof g)throw new Xa("Expected a function");return a=pa(a)||0,X(b)&&(S=!!b.leading,y="maxWait"in b&&oa(pa(b.maxWait)||0,a),r="trailing"in b?!!b.trailing:r),f.cancel=d,f.flush=function(){return(p&&B||k&&r)&&(m=
g.apply(l,n)),d(),m},f}function Zc(g,a){if("function"!=typeof g||a&&"function"!=typeof a)throw new Xa("Expected a function");var b=function(){var d=arguments,c=a?a.apply(this,d):d[0],e=b.cache;return e.has(c)?e.get(c):(d=g.apply(this,d),b.cache=e.set(c,d),d)};return b.cache=new Zc.Cache,b}function C(g,a){if("function"!=typeof g)throw new Xa("Expected a function");return a=oa(a===q?g.length-1:M(a),0),function(){for(var b=arguments,d=-1,c=oa(b.length-a,0),e=Array(c);++d<c;)e[d]=b[a+d];switch(a){case 0:return g.call(this,
e);case 1:return g.call(this,b[0],e);case 2:return g.call(this,b[0],b[1],e)}c=Array(a+1);for(d=-1;++d<a;)c[d]=b[d];return c[a]=e,l(g,this,c)}}function Wa(a,b){return a===b||a!==a&&b!==b}function b(a,b){return a>b}function m(a){return ga(a)&&fa.call(a,"callee")&&(!df.call(a,"callee")||"[object Arguments]"==ya.call(a))}function w(a){return null!=a&&!("function"==typeof a&&Ka(a))&&fd(Df(a))}function ga(a){return ha(a)&&w(a)}function oe(a){return ha(a)?"[object Error]"==ya.call(a)||"string"==typeof a.message&&
"string"==typeof a.name:!1}function Ka(a){return a=X(a)?ya.call(a):"","[object Function]"==a||"[object GeneratorFunction]"==a}function Ke(a){return"number"==typeof a&&a==M(a)}function fd(a){return"number"==typeof a&&-1<a&&0==a%1&&9007199254740991>=a}function X(a){var b=typeof a;return!!a&&("object"==b||"function"==b)}function ha(a){return!!a&&"object"==typeof a}function Le(a){return null==a?!1:Ka(a)?ef.test(bc.call(a)):ha(a)&&($a(a)?ef:Ma).test(a)}function Me(a){return"number"==typeof a||ha(a)&&"[object Number]"==
ya.call(a)}function pe(a){return!ha(a)||"[object Object]"!=ya.call(a)||$a(a)?!1:(a=he(a),null===a?!0:(a=a.constructor,"function"==typeof a&&a instanceof a&&bc.call(a)==Ef))}function ff(a){return X(a)&&"[object RegExp]"==ya.call(a)}function zc(a){return"string"==typeof a||!L(a)&&ha(a)&&"[object String]"==ya.call(a)}function gf(a){return"symbol"==typeof a||ha(a)&&"[object Symbol]"==ya.call(a)}function ad(a){return ha(a)&&fd(a.length)&&!!I[ya.call(a)]}function Ce(a,b){return b>a}function Be(a){if(!a)return[];
if(w(a))return zc(a)?a.match(O):ka(a);if(Ac&&a[Ac])return xb(a[Ac]());var b=Ja(a);return("[object Map]"==b?ec:"[object Set]"==b?Mb:le)(a)}function M(a){if(!a)return 0===a?a:0;if(a=pa(a),a===jb||a===-jb)return 1.7976931348623157E308*(0>a?-1:1);var b=a%1;return a===a?b?a-b:a:0}function hf(a){return a?Sb(M(a),0,4294967295):0}function pa(a){if(X(a)&&(a=Ka(a.valueOf)?a.valueOf():a,a=X(a)?a+"":a),"string"!=typeof a)return 0===a?a:+a;a=a.replace(ua,"");var b=bb.test(a);return b||ba.test(a)?Qb(a.slice(2),
b?2:8):id.test(a)?Cc:+a}function We(a){return fb(a,Ya(a))}function P(a){if("string"==typeof a)return a;if(null==a)return"";if(gf(a))return Kb?Ff.call(a):"";var b=a+"";return"0"==b&&1/a==-jb?"-0":b}function Kd(a,b,d){return a=null==a?q:Mc(a,b),a===q?d:a}function jf(a,b){return Td(a,b,pd)}function Ve(a,b){return Td(a,b,kd)}function sa(a){var b=Uc(a);if(!b&&!w(a))return Gf(Object(a));var d,c=Cd(a),e=!!c,c=c||[],h=c.length;for(d in a)!pd(a,d)||e&&("length"==d||Ca(d,h))||b&&"constructor"==d||c.push(d);
return c}function Ya(a){for(var b=-1,d=Uc(a),c=rd(a),e=c.length,h=Cd(a),f=!!h,h=h||[],n=h.length;++b<e;){var k=c[b];f&&("length"==k||Ca(k,n))||"constructor"==k&&(d||!fa.call(a,k))||h.push(k)}return h}function cf(a){return F(a,sa(a))}function le(a){return a?t(a,sa(a)):[]}function De(a){return kf(P(a).toLowerCase())}function Ze(a){return(a=P(a))&&a.replace(Nb,wb).replace(Na,"")}function $e(a,b){a=P(a);b=M(b);var d="";if(!a||1>b||9007199254740991<b)return d;do b%2&&(d+=a),b=ie(b/2),a+=a;while(b);return d}
function Ye(a,b,d){return a=P(a),b=d?q:b,b===q&&(b=nb.test(a)?Ob:la),a.match(b)||[]}function Ee(a){return function(){return a}}function ib(a){return a}function ze(a){return lc("function"==typeof a?a:wa(a,!0))}function Fe(b,d,c){var e=sa(d),h=Nc(d,e);null!=c||X(d)&&(h.length||!e.length)||(c=d,d=b,b=this,h=Nc(d,sa(d)));var f=X(c)&&"chain"in c?c.chain:!0,n=Ka(b);return a(h,function(a){var c=d[a];b[a]=c;n&&(b.prototype[a]=function(){var a=this.__chain__;if(f||a){var d=b(this.__wrapped__);return(d.__actions__=
ka(this.__actions__)).push({func:c,args:arguments,thisArg:b}),d.__chain__=a,d}return c.apply(b,y([this.value()],arguments))})}),b}function Ge(){}function Ue(a){return Va(a)?nc(a):sb(a)}function lf(a){return a&&a.length?ca(a,ib):0}J=J?Pa.defaults({},J,Pa.pick(Aa,Pb)):Aa;var Hf=J.Date,If=J.Error,bd=J.Math,He=J.RegExp,Xa=J.TypeError,me=J.Array.prototype,$c=J.Object.prototype,bc=J.Function.prototype.toString,fa=$c.hasOwnProperty,Jf=0,Ef=bc.call(Object),ya=$c.toString,Kf=Aa._,ef=He("^"+bc.call(fa).replace(T,
"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mf=Qd?J.Buffer:q,nf=J.Reflect,Kb=J.Symbol,je=J.Uint8Array,Md=J.clearTimeout,of=nf?nf.enumerate:q,he=Object.getPrototypeOf,Lf=Object.getOwnPropertySymbols,Ac="symbol"==typeof(Ac=Kb&&Kb.iterator)?Ac:q,zf=Object.create,df=$c.propertyIsEnumerable,ge=J.setTimeout,fe=me.splice,ke=bd.ceil,ie=bd.floor,Mf=J.isFinite,Nf=me.join,Gf=Object.keys,oa=bd.max,Za=bd.min,Of=J.parseInt,Xe=bd.random,Cf=me.reverse,vb=vc(J,"Map"),Bc=
vc(J,"Set"),cd=vc(J,"WeakMap"),dd=vc(Object,"create"),ne=cd&&new cd,Pf=vb?bc.call(vb):"",Qf=Bc?bc.call(Bc):"",Rf=cd?bc.call(cd):"",pf=Kb?Kb.prototype:q,ye=Kb?pf.valueOf:q,Ff=Kb?pf.toString:q,Ld={};d.templateSettings={escape:Fc,evaluate:Gc,interpolate:Hc,variable:"",imports:{_:d}};var Jb=Xd(Ga),Ae=Xd(pb,!0),we=yd(),Te=yd(!0);of&&!df.call({valueOf:1},"valueOf")&&(rd=function(a){return xb(of(a))});var bf=ne?function(a,b){return ne.set(a,b),a}:ib,Af=Bc&&2===(new Bc([1,2])).size?function(a){return new Bc(a)}:
Ge,xe=ne?function(a){return ne.get(a)}:Ge,Df=nc("length"),Bf=Lf||function(){return[]};(vb&&"[object Map]"!=Ja(new vb)||Bc&&"[object Set]"!=Ja(new Bc)||cd&&"[object WeakMap]"!=Ja(new cd))&&(Ja=function(a){var b=ya.call(a);if(a="[object Object]"==b?a.constructor:null,a="function"==typeof a?bc.call(a):"")switch(a){case Pf:return"[object Map]";case Qf:return"[object Set]";case Rf:return"[object WeakMap]"}return b});var af=function(){var a=0,b=0;return function(d,c){var e=Nd(),h=16-(e-b);if(b=e,0<h){if(150<=
++a)return d}else a=0;return bf(d,c)}}(),Sf=C(function(a,b){L(a)||(a=null==a?[]:[Object(a)]);b=R(b,1);for(var d=a,c=b,e=-1,h=d.length,f=-1,n=c.length,k=Array(h+n);++e<h;)k[e]=d[e];for(;++f<n;)k[e++]=c[f];return k}),Tf=C(function(a,b){return ga(a)?ob(a,R(b,1,!0)):[]}),Uf=C(function(a,b){var d=na(b);return ga(d)&&(d=q),ga(a)?ob(a,R(b,1,!0),D(d)):[]}),Vf=C(function(a,b){var d=na(b);return ga(d)&&(d=q),ga(a)?ob(a,R(b,1,!0),q,d):[]}),Wf=C(function(a){var b=p(a,od);return b.length&&b[0]===a[0]?Cb(b):[]}),
Xf=C(function(a){var b=na(a),d=p(a,od);return b===na(d)?b=q:d.pop(),d.length&&d[0]===a[0]?Cb(d,D(b)):[]}),Yf=C(function(a){var b=na(a),d=p(a,od);return b===na(d)?b=q:d.pop(),d.length&&d[0]===a[0]?Cb(d,q,b):[]}),Zf=C(be),$f=C(function(a,b){b=p(R(b,1),String);var d=kc(a,b);return td(a,b.sort(cc)),d}),ag=C(function(a){return tb(R(a,1,!0))}),bg=C(function(a){var b=na(a);return ga(b)&&(b=q),tb(R(a,1,!0),D(b))}),cg=C(function(a){var b=na(a);return ga(b)&&(b=q),tb(R(a,1,!0),q,b)}),dg=C(function(a,b){return ga(a)?
ob(a,b):[]}),eg=C(function(a){return wd(n(a,ga))}),fg=C(function(a){var b=na(a);return ga(b)&&(b=q),wd(n(a,ga),D(b))}),gg=C(function(a){var b=na(a);return ga(b)&&(b=q),wd(n(a,ga),q,b)}),hg=C(Hd),ig=C(function(a){var b=a.length,b=1<b?a[b-1]:q,b="function"==typeof b?(a.pop(),b):q;return ce(a,b)}),jg=C(function(a){a=R(a,1);var b=a.length,d=b?a[0]:0,c=this.__wrapped__,e=function(b){return kc(b,a)};return 1>=b&&!this.__actions__.length&&c instanceof K&&Ca(d)?(c=c.slice(d,+d+(b?1:0)),c.__actions__.push({func:xc,
args:[e],thisArg:q}),(new ia(c,this.__chain__)).thru(function(a){return b&&!a.length&&a.push(q),a})):this.thru(e)}),kg=Rc(function(a,b,d){fa.call(a,d)?++a[d]:a[d]=1}),lg=Rc(function(a,b,d){fa.call(a,d)?a[d].push(b):a[d]=[b]}),mg=C(function(a,b,d){var c=-1,e="function"==typeof b,h=Va(b),f=w(a)?Array(a.length):[];return Jb(a,function(a){var g=e?b:h&&null!=a?a[b]:q;f[++c]=g?l(g,a,d):Db(a,b,d)}),f}),ng=Rc(function(a,b,d){a[d]=b}),og=Rc(function(a,b,d){a[d?0:1].push(b)},function(){return[[],[]]}),pg=C(function(a,
b){if(null==a)return[];var d=b.length;return 1<d&&Ua(a,b[0],b[1])?b=[]:2<d&&Ua(b[0],b[1],b[2])&&(b.length=1),Tb(a,R(b,1),[])}),Nd=Hf.now,Ie=C(function(a,b,d){var c=1;if(d.length)var e=Da(d,Yb(Ie)),c=32|c;return Ia(a,c,b,d,e)}),qf=C(function(a,b,d){var c=3;if(d.length)var e=Da(d,Yb(qf)),c=32|c;return Ia(b,c,a,d,e)}),qg=C(function(a,b){return Rd(a,1,b)}),rg=C(function(a,b,d){return Rd(a,pa(b)||0,d)}),sg=C(function(a,b){b=p(R(b,1),D());var d=b.length;return C(function(c){for(var e=-1,h=Za(c.length,d);++e<
h;)c[e]=b[e].call(this,c[e]);return l(a,this,c)})}),Je=C(function(a,b){var d=Da(b,Yb(Je));return Ia(a,32,q,b,d)}),rf=C(function(a,b){var d=Da(b,Yb(rf));return Ia(a,64,q,b,d)}),tg=C(function(a,b){return Ia(a,256,q,q,q,R(b,1))}),L=Array.isArray,Se=mf?function(a){return a instanceof mf}:Ee(!1),ug=ma(function(a,b){fb(b,sa(b),a)}),sf=ma(function(a,b){fb(b,Ya(b),a)}),Od=ma(function(a,b,d,c){Qc(b,Ya(b),a,c)}),vg=ma(function(a,b,d,c){Qc(b,sa(b),a,c)}),wg=C(function(a,b){return kc(a,R(b,1))}),xg=C(function(a){return a.push(q,
jc),l(Od,q,a)}),yg=C(function(a){return a.push(q,Dd),l(tf,q,a)}),zg=Wb(function(a,b,d){a[b]=d},Ee(ib)),Ag=Wb(function(a,b,d){fa.call(a,b)?a[b].push(d):a[b]=[d]},D),Bg=C(Db),Cg=ma(function(a,b,d){Eb(a,b,d)}),tf=ma(function(a,b,d,c){Eb(a,b,d,c)}),Dg=C(function(a,b){return null==a?{}:(b=p(R(b,1),String),sd(a,ob(Ya(a),b)))}),Eg=C(function(a,b){return null==a?{}:sd(a,R(b,1))}),Fg=ub(function(a,b,d){return b=b.toLowerCase(),a+(d?De(b):b)}),Gg=ub(function(a,b,d){return a+(d?"-":"")+b.toLowerCase()}),Hg=
ub(function(a,b,d){return a+(d?" ":"")+b.toLowerCase()}),Ig=Yd("toLowerCase"),kf=Yd("toUpperCase"),Jg=ub(function(a,b,d){return a+(d?"_":"")+b.toLowerCase()}),Kg=ub(function(a,b,d){return a+(d?" ":"")+De(b)}),Lg=ub(function(a,b,d){return a+(d?" ":"")+b.toUpperCase()}),uf=C(function(a,b){try{return l(a,q,b)}catch(d){return oe(d)?d:new If(d)}}),Mg=C(function(b,d){return a(R(d,1),function(a){b[a]=Ie(b[a],b)}),b}),Ng=zd(),Og=zd(!0),Pg=C(function(a,b){return function(d){return Db(d,a,b)}}),Qg=C(function(a,
b){return function(d){return Db(a,d,b)}}),Rg=Ad(p),Sg=Ad(e),Tg=Ad(G),Ug=Xb(),Vg=Xb(!0),Wg=gb("ceil"),Xg=gb("floor"),Yg=gb("round");return d.prototype=cb.prototype,ia.prototype=Bb(cb.prototype),ia.prototype.constructor=ia,K.prototype=Bb(cb.prototype),K.prototype.constructor=K,ja.prototype=dd?dd(null):$c,Oa.prototype.clear=function(){this.__data__={hash:new ja,map:vb?new vb:[],string:new ja}},Oa.prototype["delete"]=function(a){var b=this.__data__;return Zb(a)?(b="string"==typeof a?b.string:b.hash,(dd?
b[a]!==q:fa.call(b,a))&&delete b[a]):vb?b.map["delete"](a):za(b.map,a)},Oa.prototype.get=function(a){var b=this.__data__;return Zb(a)?(b="string"==typeof a?b.string:b.hash,dd?(a=b[a],a="__lodash_hash_undefined__"===a?q:a):a=fa.call(b,a)?b[a]:q,a):vb?b.map.get(a):db(b.map,a)},Oa.prototype.has=function(a){var b=this.__data__;return Zb(a)?(b="string"==typeof a?b.string:b.hash,a=dd?b[a]!==q:fa.call(b,a)):a=vb?b.map.has(a):-1<Fa(b.map,a),a},Oa.prototype.set=function(a,b){var d=this.__data__;return Zb(a)?
("string"==typeof a?d.string:d.hash)[a]=dd&&b===q?"__lodash_hash_undefined__":b:vb?d.map.set(a,b):Rb(d.map,a,b),this},qa.prototype.push=function(a){var b=this.__data__;Zb(a)?(b=b.__data__,("string"==typeof a?b.string:b.hash)[a]="__lodash_hash_undefined__"):b.set(a,"__lodash_hash_undefined__")},Qa.prototype.clear=function(){this.__data__={array:[],map:null}},Qa.prototype["delete"]=function(a){var b=this.__data__,d=b.array;return d?za(d,a):b.map["delete"](a)},Qa.prototype.get=function(a){var b=this.__data__,
d=b.array;return d?db(d,a):b.map.get(a)},Qa.prototype.has=function(a){var b=this.__data__,d=b.array;return d?-1<Fa(d,a):b.map.has(a)},Qa.prototype.set=function(a,b){var d=this.__data__,c=d.array;return c&&(199>c.length?Rb(c,a,b):(d.array=null,d.map=new Oa(c))),(d=d.map)&&d.set(a,b),this},Zc.Cache=Oa,d.after=function(a,b){if("function"!=typeof b)throw new Xa("Expected a function");return a=M(a),function(){return 1>--a?b.apply(this,arguments):void 0}},d.ary=Yc,d.assign=ug,d.assignIn=sf,d.assignInWith=
Od,d.assignWith=vg,d.at=wg,d.before=Ib,d.bind=Ie,d.bindAll=Mg,d.bindKey=qf,d.castArray=function(){if(!arguments.length)return[];var a=arguments[0];return L(a)?a:[a]},d.chain=Pd,d.chunk=function(a,b){b=oa(M(b),0);var d=a?a.length:0;if(!d||1>b)return[];for(var c=0,e=-1,h=Array(ke(d/b));d>c;)h[++e]=Ha(a,c,c+=b);return h},d.compact=function(a){for(var b=-1,d=a?a.length:0,c=-1,e=[];++b<d;){var h=a[b];h&&(e[++c]=h)}return e},d.concat=Sf,d.cond=function(a){var b=a?a.length:0,d=D();return a=b?p(a,function(a){if("function"!=
typeof a[1])throw new Xa("Expected a function");return[d(a[0]),a[1]]}):[],C(function(d){for(var c=-1;++c<b;){var e=a[c];if(l(e[0],this,d))return l(e[1],this,d)}})},d.conforms=function(a){return Lc(wa(a,!0))},d.constant=Ee,d.countBy=kg,d.create=function(a,b){var d=Bb(a);return b?nd(d,b):d},d.curry=Hb,d.curryRight=Jd,d.debounce=ee,d.defaults=xg,d.defaultsDeep=yg,d.defer=qg,d.delay=rg,d.difference=Tf,d.differenceBy=Uf,d.differenceWith=Vf,d.drop=Gd,d.dropRight=Ed,d.dropRightWhile=function(a,b){return a&&
a.length?rc(a,D(b,3),!0,!0):[]},d.dropWhile=function(a,b){return a&&a.length?rc(a,D(b,3),!0):[]},d.fill=function(a,b,d,c){var e=a?a.length:0;if(!e)return[];d&&"number"!=typeof d&&Ua(a,b,d)&&(d=0,c=e);e=a.length;d=M(d);0>d&&(d=-d>e?0:e+d);c=c===q||c>e?e:M(c);0>c&&(c+=e);for(c=d>c?0:hf(c);c>d;)a[d++]=b;return a},d.filter=function(a,b){return(L(a)?n:eb)(a,D(b,3))},d.flatMap=function(a,b){return R(ac(a,b),1)},d.flatten=function(a){return a&&a.length?R(a,1):[]},d.flattenDeep=function(a){return a&&a.length?
R(a,jb):[]},d.flattenDepth=function(a,b){return a&&a.length?(b=b===q?1:M(b),R(a,b)):[]},d.flip=function(a){return Ia(a,512)},d.flow=Ng,d.flowRight=Og,d.fromPairs=function(a){for(var b=-1,d=a?a.length:0,c={};++b<d;){var e=a[b];c[e[0]]=e[1]}return c},d.functions=function(a){return null==a?[]:Nc(a,sa(a))},d.functionsIn=function(a){return null==a?[]:Nc(a,Ya(a))},d.groupBy=lg,d.initial=function(a){return Ed(a,1)},d.intersection=Wf,d.intersectionBy=Xf,d.intersectionWith=Yf,d.invert=zg,d.invertBy=Ag,d.invokeMap=
mg,d.iteratee=ze,d.keyBy=ng,d.keys=sa,d.keysIn=Ya,d.map=ac,d.mapKeys=function(a,b){var d={};return b=D(b,3),Ga(a,function(a,g,c){d[b(a,g,c)]=a}),d},d.mapValues=function(a,b){var d={};return b=D(b,3),Ga(a,function(a,g,c){d[g]=b(a,g,c)}),d},d.matches=function(a){return Ub(wa(a,!0))},d.matchesProperty=function(a,b){return Ud(a,wa(b,!0))},d.memoize=Zc,d.merge=Cg,d.mergeWith=tf,d.method=Pg,d.methodOf=Qg,d.mixin=Fe,d.negate=function(a){if("function"!=typeof a)throw new Xa("Expected a function");return function(){return!a.apply(this,
arguments)}},d.nthArg=function(a){return a=M(a),function(){return arguments[a]}},d.omit=Dg,d.omitBy=function(a,b){return b=D(b),mc(a,function(a,d){return!b(a,d)})},d.once=function(a){return Ib(2,a)},d.orderBy=function(a,b,d,c){return null==a?[]:(L(b)||(b=null==b?[]:[b]),d=c?q:d,L(d)||(d=null==d?[]:[d]),Tb(a,b,d))},d.over=Rg,d.overArgs=sg,d.overEvery=Sg,d.overSome=Tg,d.partial=Je,d.partialRight=rf,d.partition=og,d.pick=Eg,d.pickBy=function(a,b){return null==a?{}:mc(a,D(b))},d.property=Ue,d.propertyOf=
function(a){return function(b){return null==a?q:Mc(a,b)}},d.pull=Zf,d.pullAll=be,d.pullAllBy=function(a,b,d){return a&&a.length&&b&&b.length?oc(a,b,D(d)):a},d.pullAt=$f,d.range=Ug,d.rangeRight=Vg,d.rearg=tg,d.reject=function(a,b){var d=L(a)?n:eb;return b=D(b,3),d(a,function(a,d,g){return!b(a,d,g)})},d.remove=function(a,b){var d=[];if(!a||!a.length)return d;var c=-1,e=[],h=a.length;for(b=D(b,3);++c<h;){var f=a[c];b(f,c,a)&&(d.push(f),e.push(c))}return td(a,e),d},d.rest=C,d.reverse=Wc,d.sampleSize=
Xc,d.set=function(a,b,d){return null==a?a:Pc(a,b,d)},d.setWith=function(a,b,d,c){return c="function"==typeof c?c:q,null==a?a:Pc(a,b,d,c)},d.shuffle=function(a){return Xc(a,4294967295)},d.slice=function(a,b,d){var c=a?a.length:0;return c?(d&&"number"!=typeof d&&Ua(a,b,d)?(b=0,d=c):(b=null==b?0:M(b),d=d===q?c:M(d)),Ha(a,b,d)):[]},d.sortBy=pg,d.sortedUniq=function(a){return a&&a.length?ud(a):[]},d.sortedUniqBy=function(a,b){return a&&a.length?ud(a,D(b)):[]},d.split=function(a,b,d){return P(a).split(b,
d)},d.spread=function(a,b){if("function"!=typeof a)throw new Xa("Expected a function");return b=b===q?0:oa(M(b),0),C(function(d){var c=d[b];return d=d.slice(0,b),c&&y(d,c),l(a,this,d)})},d.tail=function(a){return Gd(a,1)},d.take=function(a,b,d){return a&&a.length?(b=d||b===q?1:M(b),Ha(a,0,0>b?0:b)):[]},d.takeRight=function(a,b,d){var c=a?a.length:0;return c?(b=d||b===q?1:M(b),b=c-b,Ha(a,0>b?0:b,c)):[]},d.takeRightWhile=function(a,b){return a&&a.length?rc(a,D(b,3),!1,!0):[]},d.takeWhile=function(a,
b){return a&&a.length?rc(a,D(b,3)):[]},d.tap=function(a,b){return b(a),a},d.throttle=function(a,b,d){var c=!0,e=!0;if("function"!=typeof a)throw new Xa("Expected a function");return X(d)&&(c="leading"in d?!!d.leading:c,e="trailing"in d?!!d.trailing:e),ee(a,b,{leading:c,maxWait:b,trailing:e})},d.thru=xc,d.toArray=Be,d.toPairs=cf,d.toPairsIn=function(a){return F(a,Ya(a))},d.toPath=function(a){return L(a)?p(a,String):Vc(a)},d.toPlainObject=We,d.transform=function(b,d,c){var e=L(b)||ad(b);if(d=D(d,4),
null==c)if(e||X(b)){var h=b.constructor;c=e?L(b)?new h:[]:Ka(h)?Bb(he(b)):{}}else c={};return(e?a:Ga)(b,function(a,b,g){return d(c,a,b,g)}),c},d.unary=function(a){return Yc(a,1)},d.union=ag,d.unionBy=bg,d.unionWith=cg,d.uniq=function(a){return a&&a.length?tb(a):[]},d.uniqBy=function(a,b){return a&&a.length?tb(a,D(b)):[]},d.uniqWith=function(a,b){return a&&a.length?tb(a,q,b):[]},d.unset=function(a,b){var d;if(null==a)d=!0;else{d=a;var c=b,c=Va(c,d)?[c+""]:Ra(c);d=$b(d,c);c=na(c);d=null!=d&&jf(d,c)?
delete d[c]:!0}return d},d.unzip=Hd,d.unzipWith=ce,d.values=le,d.valuesIn=function(a){return null==a?[]:t(a,Ya(a))},d.without=dg,d.words=Ye,d.wrap=function(a,b){return b=null==b?ib:b,Je(b,a)},d.xor=eg,d.xorBy=fg,d.xorWith=gg,d.zip=hg,d.zipObject=function(a,b){return xd(a||[],b||[],Z)},d.zipObjectDeep=function(a,b){return xd(a||[],b||[],Pc)},d.zipWith=ig,d.extend=sf,d.extendWith=Od,Fe(d,d),d.add=function(a,b){var d;return a===q&&b===q?0:(a!==q&&(d=a),b!==q&&(d=d===q?b:d+b),d)},d.attempt=uf,d.camelCase=
Fg,d.capitalize=De,d.ceil=Wg,d.clamp=function(a,b,d){return d===q&&(d=b,b=q),d!==q&&(d=pa(d),d=d===d?d:0),b!==q&&(b=pa(b),b=b===b?b:0),Sb(pa(a),b,d)},d.clone=function(a){return wa(a)},d.cloneDeep=function(a){return wa(a,!0)},d.cloneDeepWith=function(a,b){return wa(a,!0,b)},d.cloneWith=function(a,b){return wa(a,!1,b)},d.deburr=Ze,d.endsWith=function(a,b,d){a=P(a);b="string"==typeof b?b:b+"";var c=a.length;return d=d===q?c:Sb(M(d),0,c),d-=b.length,0<=d&&a.indexOf(b,d)==d},d.eq=Wa,d.escape=function(a){return(a=
P(a))&&Ec.test(a)?a.replace(kb,ed):a},d.escapeRegExp=function(a){return(a=P(a))&&Jc.test(a)?a.replace(T,"\\$&"):a},d.every=function(a,b,d){var c=L(a)?e:Sd;return d&&Ua(a,b,d)&&(b=q),c(a,D(b,3))},d.find=function(a,b){if(b=D(b,3),L(a)){var d=E(a,b);return-1<d?a[d]:q}return A(a,b,Jb)},d.findIndex=function(a,b){return a&&a.length?E(a,D(b,3)):-1},d.findKey=function(a,b){return A(a,D(b,3),Ga,!0)},d.findLast=function(a,b){if(b=D(b,3),L(a)){var d=E(a,b,!0);return-1<d?a[d]:q}return A(a,b,Ae)},d.findLastIndex=
function(a,b){return a&&a.length?E(a,D(b,3),!0):-1},d.findLastKey=function(a,b){return A(a,D(b,3),pb,!0)},d.floor=Xg,d.forEach=yc,d.forEachRight=Id,d.forIn=function(a,b){return null==a?a:we(a,Sa(b),Ya)},d.forInRight=function(a,b){return null==a?a:Te(a,Sa(b),Ya)},d.forOwn=function(a,b){return a&&Ga(a,Sa(b))},d.forOwnRight=function(a,b){return a&&pb(a,Sa(b))},d.get=Kd,d.gt=b,d.gte=function(a,b){return a>=b},d.has=jf,d.hasIn=Ve,d.head=Ba,d.identity=ib,d.includes=function(a,b,d,c){return a=w(a)?a:le(a),
d=d&&!c?M(d):0,c=a.length,0>d&&(d=oa(c+d,0)),zc(a)?c>=d&&-1<a.indexOf(b,d):!!c&&-1<r(a,b,d)},d.indexOf=function(a,b,d){var c=a?a.length:0;return c?(d=M(d),0>d&&(d=oa(c+d,0)),r(a,b,d)):-1},d.inRange=function(a,b,d){return b=pa(b)||0,d===q?(d=b,b=0):d=pa(d)||0,a=pa(a),a>=Za(b,d)&&a<oa(b,d)},d.invoke=Bg,d.isArguments=m,d.isArray=L,d.isArrayBuffer=function(a){return ha(a)&&"[object ArrayBuffer]"==ya.call(a)},d.isArrayLike=w,d.isArrayLikeObject=ga,d.isBoolean=function(a){return!0===a||!1===a||ha(a)&&"[object Boolean]"==
ya.call(a)},d.isBuffer=Se,d.isDate=function(a){return ha(a)&&"[object Date]"==ya.call(a)},d.isElement=function(a){return!!a&&1===a.nodeType&&ha(a)&&!pe(a)},d.isEmpty=function(a){if(w(a)&&(L(a)||zc(a)||Ka(a.splice)||m(a)))return!a.length;for(var b in a)if(fa.call(a,b))return!1;return!0},d.isEqual=function(a,b){return qb(a,b)},d.isEqualWith=function(a,b,d){var c=(d="function"==typeof d?d:q)?d(a,b):q;return c===q?qb(a,b,d):!!c},d.isError=oe,d.isFinite=function(a){return"number"==typeof a&&Mf(a)},d.isFunction=
Ka,d.isInteger=Ke,d.isLength=fd,d.isMap=function(a){return ha(a)&&"[object Map]"==Ja(a)},d.isMatch=function(a,b){return a===b||rb(a,b,Tc(b))},d.isMatchWith=function(a,b,d){return d="function"==typeof d?d:q,rb(a,b,Tc(b),d)},d.isNaN=function(a){return Me(a)&&a!=+a},d.isNative=Le,d.isNil=function(a){return null==a},d.isNull=function(a){return null===a},d.isNumber=Me,d.isObject=X,d.isObjectLike=ha,d.isPlainObject=pe,d.isRegExp=ff,d.isSafeInteger=function(a){return Ke(a)&&-9007199254740991<=a&&9007199254740991>=
a},d.isSet=function(a){return ha(a)&&"[object Set]"==Ja(a)},d.isString=zc,d.isSymbol=gf,d.isTypedArray=ad,d.isUndefined=function(a){return a===q},d.isWeakMap=function(a){return ha(a)&&"[object WeakMap]"==Ja(a)},d.isWeakSet=function(a){return ha(a)&&"[object WeakSet]"==ya.call(a)},d.join=function(a,b){return a?Nf.call(a,b):""},d.kebabCase=Gg,d.last=na,d.lastIndexOf=function(a,b,d){var c=a?a.length:0;if(!c)return-1;var e=c;if(d!==q&&(e=M(d),e=(0>e?oa(c+e,0):Za(e,c-1))+1),b!==b)return Lb(a,e,!0);for(;e--;)if(a[e]===
b)return e;return-1},d.lowerCase=Hg,d.lowerFirst=Ig,d.lt=Ce,d.lte=function(a,b){return b>=a},d.max=function(a){return a&&a.length?z(a,ib,b):q},d.maxBy=function(a,d){return a&&a.length?z(a,D(d),b):q},d.mean=function(a){return lf(a)/(a?a.length:0)},d.min=function(a){return a&&a.length?z(a,ib,Ce):q},d.minBy=function(a,b){return a&&a.length?z(a,D(b),Ce):q},d.noConflict=function(){return Aa._===this&&(Aa._=Kf),this},d.noop=Ge,d.now=Nd,d.pad=function(a,b,d){a=P(a);b=M(b);var c=ea(a);return b&&b>c?(c=(b-
c)/2,b=ie(c),c=ke(c),Gb("",b,d)+a+Gb("",c,d)):a},d.padEnd=function(a,b,d){return a=P(a),a+Gb(a,b,d)},d.padStart=function(a,b,d){return a=P(a),Gb(a,b,d)+a},d.parseInt=function(a,b,d){return d||null==b?b=0:b&&(b=+b),a=P(a).replace(ua,""),Of(a,b||(V.test(a)?16:10))},d.random=function(a,b,d){if(d&&"boolean"!=typeof d&&Ua(a,b,d)&&(b=d=q),d===q&&("boolean"==typeof b?(d=b,b=q):"boolean"==typeof a&&(d=a,a=q)),a===q&&b===q?(a=0,b=1):(a=pa(a)||0,b===q?(b=a,a=0):b=pa(b)||0),a>b){var c=a;a=b;b=c}return d||a%
1||b%1?(d=Xe(),Za(a+d*(b-a+qe("1e-"+((d+"").length-1))),b)):Oc(a,b)},d.reduce=function(a,b,d){var c=L(a)?x:H,e=3>arguments.length;return c(a,D(b,4),d,e,Jb)},d.reduceRight=function(a,b,d){var c=L(a)?N:H,e=3>arguments.length;return c(a,D(b,4),d,e,Ae)},d.repeat=$e,d.replace=function(){var a=arguments,b=P(a[0]);return 3>a.length?b:b.replace(a[1],a[2])},d.result=function(a,b,d){if(Va(b,a))c=null==a?q:a[b];else{b=Ra(b);var c=Kd(a,b);a=$b(a,b)}return c===q&&(c=d),Ka(c)?c.call(a):c},d.round=Yg,d.runInContext=
ab,d.sample=function(a){a=w(a)?a:le(a);var b=a.length;return 0<b?a[Oc(0,b-1)]:q},d.size=function(a){if(null==a)return 0;if(w(a)){var b=a.length;return b&&zc(a)?ea(a):b}return sa(a).length},d.snakeCase=Jg,d.some=function(a,b,d){var c=L(a)?G:Vd;return d&&Ua(a,b,d)&&(b=q),c(a,D(b,3))},d.sortedIndex=function(a,b){return pc(a,b)},d.sortedIndexBy=function(a,b,d){return qc(a,b,D(d))},d.sortedIndexOf=function(a,b){var d=a?a.length:0;if(d){var c=pc(a,b);if(d>c&&Wa(a[c],b))return c}return-1},d.sortedLastIndex=
function(a,b){return pc(a,b,!0)},d.sortedLastIndexBy=function(a,b,d){return qc(a,b,D(d),!0)},d.sortedLastIndexOf=function(a,b){if(a&&a.length){var d=pc(a,b,!0)-1;if(Wa(a[d],b))return d}return-1},d.startCase=Kg,d.startsWith=function(a,b,d){return a=P(a),d=Sb(M(d),0,a.length),a.lastIndexOf(b,d)==d},d.subtract=function(a,b){var d;return a===q&&b===q?0:(a!==q&&(d=a),b!==q&&(d=d===q?b:d-b),d)},d.sum=lf,d.sumBy=function(a,b){return a&&a.length?ca(a,D(b)):0},d.template=function(a,b,c){var e=d.templateSettings;
c&&Ua(a,b,c)&&(b=q);a=P(a);b=Od({},b,e,jc);c=Od({},b.imports,e.imports,jc);var h,f,n=sa(c),k=t(c,n),m=0;c=b.interpolate||Ea;var l="__p+='";c=He((b.escape||Ea).source+"|"+c.source+"|"+(c===Hc?aa:Ea).source+"|"+(b.evaluate||Ea).source+"|$","g");var p="sourceURL"in b?"//# sourceURL="+b.sourceURL+"\n":"";if(a.replace(c,function(b,d,c,e,n,k){return c||(c=e),l+=a.slice(m,k).replace(va,dc),d&&(h=!0,l+="'+__e("+d+")+'"),n&&(f=!0,l+="';"+n+";\n__p+='"),c&&(l+="'+((__t=("+c+"))==null?'':__t)+'"),m=k+b.length,
b}),l+="';",(b=b.variable)||(l="with(obj){"+l+"}"),l=(f?l.replace(zb,""):l).replace(Dc,"$1").replace(fc,"$1;"),l="function("+(b||"obj")+"){"+(b?"":"obj||(obj={});")+"var __t,__p=''"+(h?",__e=_.escape":"")+(f?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",b=uf(function(){return Function(n,p+"return "+l).apply(q,k)}),b.source=l,oe(b))throw b;return b},d.times=function(a,b){if(a=M(a),1>a||9007199254740991<a)return[];var d=4294967295,c=Za(a,4294967295);
b=Sa(b);a-=4294967295;for(c=da(c,b);++d<a;)b(d);return c},d.toInteger=M,d.toLength=hf,d.toLower=function(a){return P(a).toLowerCase()},d.toNumber=pa,d.toSafeInteger=function(a){return Sb(M(a),-9007199254740991,9007199254740991)},d.toString=P,d.toUpper=function(a){return P(a).toUpperCase()},d.trim=function(a,b,d){return(a=P(a))?d||b===q?a.replace(ua,""):(b+="")?(a=a.match(O),b=b.match(O),a.slice(U(a,b),S(a,b)+1).join("")):a:a},d.trimEnd=function(a,b,d){return(a=P(a))?d||b===q?a.replace(hc,""):(b+=
"")?(a=a.match(O),a.slice(0,S(a,b.match(O))+1).join("")):a:a},d.trimStart=function(a,b,d){return(a=P(a))?d||b===q?a.replace(lb,""):(b+="")?(a=a.match(O),a.slice(U(a,b.match(O))).join("")):a:a},d.truncate=function(a,b){var d=30,c="...";if(X(b))var e="separator"in b?b.separator:e,d="length"in b?M(b.length):d,c="omission"in b?P(b.omission):c;a=P(a);var h=a.length;if(Y.test(a))var f=a.match(O),h=f.length;if(d>=h)return a;if(h=d-ea(c),1>h)return c;if(d=f?f.slice(0,h).join(""):a.slice(0,h),e===q)return d+
c;if(f&&(h+=d.length-h),ff(e)){if(a.slice(h).search(e)){var n=d;e.global||(e=He(e.source,P(mb.exec(e))+"g"));for(e.lastIndex=0;f=e.exec(n);)var k=f.index;d=d.slice(0,k===q?h:k)}}else a.indexOf(e,h)!=h&&(e=d.lastIndexOf(e),-1<e&&(d=d.slice(0,e)));return d+c},d.unescape=function(a){return(a=P(a))&&Ab.test(a)?a.replace(gc,yb):a},d.uniqueId=function(a){var b=++Jf;return P(a)+b},d.upperCase=Lg,d.upperFirst=kf,d.each=yc,d.eachRight=Id,d.first=Ba,Fe(d,function(){var a={};return Ga(d,function(b,c){fa.call(d.prototype,
c)||(a[c]=b)}),a}(),{chain:!1}),d.VERSION="4.5.1",a("bind bindKey curry curryRight partial partialRight".split(" "),function(a){d[a].placeholder=d}),a(["drop","take"],function(a,b){K.prototype[a]=function(d){var c=this.__filtered__;if(c&&!b)return new K(this);d=d===q?1:oa(M(d),0);var e=this.clone();return c?e.__takeCount__=Za(d,e.__takeCount__):e.__views__.push({size:Za(d,4294967295),type:a+(0>e.__dir__?"Right":"")}),e};K.prototype[a+"Right"]=function(b){return this.reverse()[a](b).reverse()}}),a(["filter",
"map","takeWhile"],function(a,b){var d=b+1,c=1==d||3==d;K.prototype[a]=function(a){var b=this.clone();return b.__iteratees__.push({iteratee:D(a,3),type:d}),b.__filtered__=b.__filtered__||c,b}}),a(["head","last"],function(a,b){var d="take"+(b?"Right":"");K.prototype[a]=function(){return this[d](1).value()[0]}}),a(["initial","tail"],function(a,b){var d="drop"+(b?"":"Right");K.prototype[a]=function(){return this.__filtered__?new K(this):this[d](1)}}),K.prototype.compact=function(){return this.filter(ib)},
K.prototype.find=function(a){return this.filter(a).head()},K.prototype.findLast=function(a){return this.reverse().find(a)},K.prototype.invokeMap=C(function(a,b){return"function"==typeof a?new K(this):this.map(function(d){return Db(d,a,b)})}),K.prototype.reject=function(a){return a=D(a,3),this.filter(function(b){return!a(b)})},K.prototype.slice=function(a,b){a=M(a);var d=this;return d.__filtered__&&(0<a||0>b)?new K(d):(0>a?d=d.takeRight(-a):a&&(d=d.drop(a)),b!==q&&(b=M(b),d=0>b?d.dropRight(-b):d.take(b-
a)),d)},K.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},K.prototype.toArray=function(){return this.take(4294967295)},Ga(K.prototype,function(a,b){var c=/^(?:filter|find|map|reject)|While$/.test(b),e=/^(?:head|last)$/.test(b),h=d[e?"take"+("last"==b?"Right":""):b],f=e||/^find/.test(b);h&&(d.prototype[b]=function(){var b=this.__wrapped__,n=e?[1]:arguments,k=b instanceof K,m=n[0],l=k||L(b),t=function(a){return a=h.apply(d,y([a],n)),e&&p?a[0]:a};l&&c&&"function"==
typeof m&&1!=m.length&&(k=l=!1);var p=this.__chain__,B=!!this.__actions__.length,m=f&&!p,k=k&&!B;return!f&&l?(b=k?b:new K(this),b=a.apply(b,n),b.__actions__.push({func:xc,args:[t],thisArg:q}),new ia(b,p)):m&&k?a.apply(this,n):(b=this.thru(t),m?e?b.value()[0]:b.value():b)})}),a("pop push shift sort splice unshift".split(" "),function(a){var b=me[a],c=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",e=/^(?:pop|shift)$/.test(a);d.prototype[a]=function(){var a=arguments;return e&&!this.__chain__?b.apply(this.value(),
a):this[c](function(d){return b.apply(d,a)})}}),Ga(K.prototype,function(a,b){var c=d[b];if(c){var e=c.name+"";(Ld[e]||(Ld[e]=[])).push({name:b,func:c})}}),Ld[Ta(q,2).name]=[{name:"wrapper",func:q}],K.prototype.clone=function(){var a=new K(this.__wrapped__);return a.__actions__=ka(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=ka(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=ka(this.__views__),a},K.prototype.reverse=function(){if(this.__filtered__){var a=
new K(this);a.__dir__=-1;a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a},K.prototype.value=function(){var a,b=this.__wrapped__.value(),d=this.__dir__,c=L(b),e=0>d,h=c?b.length:0;a=0;for(var f=h,n=this.__views__,k=-1,m=n.length;++k<m;){var l=n[k],t=l.size;switch(l.type){case "drop":a+=t;break;case "dropRight":f-=t;break;case "take":f=Za(f,a+t);break;case "takeRight":a=oa(a,f-t)}}if(a={start:a,end:f},f=a.start,n=a.end,a=n-f,e=e?n:f-1,f=this.__iteratees__,n=f.length,k=0,m=Za(a,this.__takeCount__),
!c||200>h||h==a&&m==a)return vd(b,this.__actions__);c=[];a:for(;a--&&m>k;){e+=d;h=-1;for(l=b[e];++h<n;){var p=f[h],t=p.type,p=(0,p.iteratee)(l);if(2==t)l=p;else if(!p){if(1==t)continue a;break a}}c[k++]=l}return c},d.prototype.at=jg,d.prototype.chain=function(){return Pd(this)},d.prototype.commit=function(){return new ia(this.value(),this.__chain__)},d.prototype.flatMap=function(a){return this.map(a).flatten()},d.prototype.next=function(){this.__values__===q&&(this.__values__=Be(this.value()));var a=
this.__index__>=this.__values__.length,b=a?q:this.__values__[this.__index__++];return{done:a,value:b}},d.prototype.plant=function(a){for(var b,d=this;d instanceof cb;){var c=Fd(d);c.__index__=0;c.__values__=q;b?e.__wrapped__=c:b=c;var e=c,d=d.__wrapped__}return e.__wrapped__=a,b},d.prototype.reverse=function(){var a=this.__wrapped__;return a instanceof K?(this.__actions__.length&&(a=new K(this)),a=a.reverse(),a.__actions__.push({func:xc,args:[Wc],thisArg:q}),new ia(a,this.__chain__)):this.thru(Wc)},
d.prototype.toJSON=d.prototype.valueOf=d.prototype.value=function(){return vd(this.__wrapped__,this.__actions__)},Ac&&(d.prototype[Ac]=de),d}var q,jb=1/0,Cc=NaN,zb=/\b__p\+='';/g,Dc=/\b(__p\+=)''\+/g,fc=/(__e\(.*?\)|\b__t\))\+'';/g,gc=/&(?:amp|lt|gt|quot|#39|#96);/g,kb=/[&<>"'`]/g,Ab=RegExp(gc.source),Ec=RegExp(kb.source),Fc=/<%-([\s\S]+?)%>/g,Gc=/<%([\s\S]+?)%>/g,Hc=/<%=([\s\S]+?)%>/g,gd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,La=/^\w*$/,Ic=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,
T=/[\\^$.*+?()[\]{}|]/g,Jc=RegExp(T.source),ua=/^\s+|\s+$/g,lb=/^\s+/,hc=/\s+$/,hd=/\\(\\)?/g,aa=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mb=/\w*$/,V=/^0x/i,id=/^[-+]0x[0-9a-f]+$/i,bb=/^0b[01]+$/i,Ma=/^\[object .+?Constructor\]$/,ba=/^0o[0-7]+$/i,qa=/^(?:0|[1-9]\d*)$/,Nb=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Ea=/($^)/,va=/['\n\r\u2028\u2029\\]/g,Na=/[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]/g,O=/\ud83c[\udffb-\udfff](?=\ud83c[\udffb-\udfff])|(?:[^\ud800-\udfff][\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]?|[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g,
Y=/[\u200d\ud800-\udfff\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ufe0e\ufe0f]/,la=/[a-zA-Z0-9]+/g,Ob=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2018\u2019\u201c\u201d \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2018\u2019\u201c\u201d \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2018\u2019\u201c\u201d \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2018\u2019\u201c\u201d \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2018\u2019\u201c\u201d \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+|[A-Z\xc0-\xd6\xd8-\xde]+|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g,
nb=/[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pb="Array Buffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=
I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0;I["[object Arguments]"]=I["[object Array]"]=I["[object ArrayBuffer]"]=I["[object Boolean]"]=I["[object Date]"]=I["[object Error]"]=I["[object Function]"]=I["[object Map]"]=I["[object Number]"]=I["[object Object]"]=I["[object RegExp]"]=I["[object Set]"]=I["[object String]"]=I["[object WeakMap]"]=!1;var B={};B["[object Arguments]"]=B["[object Array]"]=B["[object ArrayBuffer]"]=B["[object Boolean]"]=B["[object Date]"]=B["[object Float32Array]"]=
B["[object Float64Array]"]=B["[object Int8Array]"]=B["[object Int16Array]"]=B["[object Int32Array]"]=B["[object Map]"]=B["[object Number]"]=B["[object Object]"]=B["[object RegExp]"]=B["[object Set]"]=B["[object String]"]=B["[object Symbol]"]=B["[object Uint8Array]"]=B["[object Uint8ClampedArray]"]=B["[object Uint16Array]"]=B["[object Uint32Array]"]=!0;B["[object Error]"]=B["[object Function]"]=B["[object WeakMap]"]=!1;var cb={"\u00c0":"A","\u00c1":"A","\u00c2":"A","\u00c3":"A","\u00c4":"A","\u00c5":"A",
"\u00e0":"a","\u00e1":"a","\u00e2":"a","\u00e3":"a","\u00e4":"a","\u00e5":"a","\u00c7":"C","\u00e7":"c","\u00d0":"D","\u00f0":"d","\u00c8":"E","\u00c9":"E","\u00ca":"E","\u00cb":"E","\u00e8":"e","\u00e9":"e","\u00ea":"e","\u00eb":"e","\u00cc":"I","\u00cd":"I","\u00ce":"I","\u00cf":"I","\u00ec":"i","\u00ed":"i","\u00ee":"i","\u00ef":"i","\u00d1":"N","\u00f1":"n","\u00d2":"O","\u00d3":"O","\u00d4":"O","\u00d5":"O","\u00d6":"O","\u00d8":"O","\u00f2":"o","\u00f3":"o","\u00f4":"o","\u00f5":"o","\u00f6":"o",
"\u00f8":"o","\u00d9":"U","\u00da":"U","\u00db":"U","\u00dc":"U","\u00f9":"u","\u00fa":"u","\u00fb":"u","\u00fc":"u","\u00dd":"Y","\u00fd":"y","\u00ff":"y","\u00c6":"Ae","\u00e6":"ae","\u00de":"Th","\u00fe":"th","\u00df":"ss"},ia={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},Oa={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},ja={"function":!0,object:!0},jd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qe=parseFloat,Qb=parseInt,
db=ja[typeof exports]&&exports&&!exports.nodeType?exports:q,ra=ja[typeof module]&&module&&!module.nodeType?module:q,Qd=ra&&ra.exports===db?db:q,kd=J(db&&ra&&"object"==typeof global&&global),Fa=J(ja[typeof self]&&self),za=J(ja[typeof window]&&window),ja=J(ja[typeof this]&&this),Aa=kd||za!==(ja&&ja.window)&&za||Fa||ja||Function("return this")(),Pa=ab();(za||Fa||{})._=Pa;"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("third_party/lo-dash/lo-dash.min",[],function(){return Pa}):
db&&ra?(Qd&&((ra.exports=Pa)._=Pa),db._=Pa):Aa._=Pa}).call(this);
define("qowtRoot/utils/typeUtils",[],function(){function c(c,a,e){if(e.types.every(function(a){var c=l[a];if(!c)throw Error("Bad config to checkArgTypes: unknown type: "+a);return!c(e.value)})){var n=1===e.types.length?e.types[0]:"["+e.types.join(",")+"]";throw Error("Argument "+a+" passed to function "+c+" was supposed to be of type "+n+" but had value "+e.value);}}var k={checkArgTypes:function(f,a){for(var e in a){var n={value:a[e][0],types:a[e].slice(1)};c(f,e,n)}},isObject:function(c){return"object"===
typeof c&&null!==c},isPromise:function(c){return c instanceof Promise},isPromiseLike:function(c){return!(!c||!k.isFunction(c.then))},isList:function(c){return"[object Array]"===Object.prototype.toString.call(c)},isNumber:function(c){return"number"===typeof c&&!isNaN(c)},isInteger:function(c){return"number"===typeof c&&parseInt(c,10)===c},isFunction:function(c){return"function"===typeof c},isString:function(c){return"[object String]"===Object.prototype.toString.call(c)},isRegex:function(c){return"[object RegExp]"===
Object.prototype.toString.call(c)},isNode:function(c){return c instanceof Node},isNull:function(c){return null===c},isUndefined:function(c){return void 0===c},isBoolean:function(c){return"boolean"===typeof c},getType:function(c){var a;Object.keys(l).forEach(function(e){l[e](c)&&(a=e)});return a},isArgumentsObjectOrList:function(c){return c instanceof Object&&c.hasOwnProperty("length")},extend:function(c,a){for(var e in a)a.hasOwnProperty(e)&&(c[e]=a[e])},createNewType:function(c){var a=function(){},
e={isOfType:function(c){return void 0!==c&&null!==c&&c.constructor===a},markAsType:function(c){Object.defineProperty(c,"constructor",{value:a,configurable:!1,writable:!1,enumerable:!1});return c}};if(c){if(l[c])throw Error("Already registered type "+c);l[c]=e.isOfType}return e}},l={string:k.isString,object:k.isObject,promise:k.isPromise,promiseLike:k.isPromiseLike,node:k.isNode,regex:k.isRegex,"function":k.isFunction,number:k.isNumber,list:k.isList,boolean:k.isBoolean,"null":k.isNull,undefined:k.isUndefined};
return k});
define("qowtRoot/configs/common",[],function(){var c={SUPPORTED_IMAGE_FORMATS:{jpg:!0,jpeg:!0,gif:!0,png:!0,pic:!1,pict:!1,bmp:!0,tif:!0,tiff:!0},ZOOM:{current:void 0,next:void 0,levels:void 0},LAYOUT_DEFAULT_MAXZOOM:void 0,LAYOUT_DEFAULT_MINZOOM:void 0,LAYOUT_DEFAULT_ZOOM_LEVEL:void 0,DOC_VERIFY_DEBOUNCE:50,DEFAULT_COLORS:"#6B9CD4 #DE7872 #B7D37C #A48CC2 #6CC7E1 #F3AB63 #AEC8EE".split(" "),TEXT_STYLE:{defaultHighlightColor:"rgb(255, 255, 255)",defaultTxtColor:"rgb(0, 0, 0)",shadowText:{setValue:"#000000 0.07em 0.07em 0.07em",getValue:"rgb(0, 0, 0) 0.07em 0.07em 0.07em"},
outlineText:{webkitTextFillColor:"transparent",webkitTextStroke:".05em #000000",webkitTextStrokeWidth:"0.05em",webkitTextStrokeColor:"rgb(0, 0, 0)"},embossedText:{setColor:"#ffffff",getColor:"rgb(255, 255, 255)",setShadow:"#000000 1px 1px 2px",getShadow:"rgb(0, 0, 0) 1px 1px 2px"},engravedText:{setColor:"#999999",getColor:"rgb(153, 153, 153)",setShadow:"#000000 -1px -1px 2px",getShadow:"rgb(0, 0, 0) -1px -1px 2px"}},DEFAULT_BLIP_FILL_PROPERTIES:{tileProps:{Sx:100,Sy:100,Tx:0,Ty:0,align:"TL"},type:"tileFill"},
kMESSAGE_BUS_CONNECTION_RETRY:10,kMESSAGE_BUS_CONNECTION_TIMEOUT:3E4,kMESSAGE_BUS_CONNECTION_TIMEOUT_MSG:"MessageBus: Connection timeout",create:function(){return{SUPPORTED_IMAGE_FORMATS:c.SUPPORTED_IMAGE_FORMATS,DIALOGUE_CONFIG:c.DIALOGUE_CONFIG,DEFAULT_COLORS:c.DEFAULT_COLORS,ZOOM:c.ZOOM,LAYOUT_DEFAULT_MAXZOOM:c.LAYOUT_DEFAULT_MAXZOOM,LAYOUT_DEFAULT_MINZOOM:c.LAYOUT_DEFAULT_MINZOOM,LAYOUT_DEFAULT_ZOOM_LEVEL:c.LAYOUT_DEFAULT_ZOOM_LEVEL}}};return c});
(function(c){c("qowtRoot/third_party/when/lib/timer",["require"],function(c){return{set:setTimeout,clear:clearTimeout}})})("function"===typeof define&&define.amd?define:function(c){module.exports=c(require)});
(function(c){c("qowtRoot/third_party/when/lib/timed",[],function(){return function(c,l,f){f.prototype.delay=function(a){var e=this;return new this.constructor(function(f,l,h){e.then(function(e){c(function(){f(e)},a)},l,h)})};f.prototype.timeout=function(a,e){var f=this,v=1<arguments.length;return new this.constructor(function(h,p,y){var x=c(function(){p(v?e:Error("timed out after "+a+"ms"))},a);f.then(function(a){l(x);h(a)},function(a){l(x);p(a)},y)})};return f}})})("function"===typeof define&&define.amd?
define:function(c){module.exports=c()});
(function(c){c("qowtRoot/third_party/when/lib/array",[],function(){return function(c){var l=Array.prototype.map,f=Array.prototype.reduce,a=Array.prototype.reduceRight,e=Array.prototype.forEach,n=c.resolve,v=c.all;c.any=function(a){return new c(function(c,f){function k(a){v.push(a);0===--l&&f(v)}var l=0,v=[];e.call(a,function(a){++l;n(a).then(c,k)});0===l&&c()})};c.some=function(a,f){return new c(function(c,k,l){function v(a){0<A&&(--A,r.push(a),0===A&&c(r))}function z(a){0<E&&(--E,H.push(a),0===E&&
k(H))}var A=0,E,r=[],H=[];e.call(a,function(a){++A;n(a).then(v,z,l)});f=Math.max(f,0);E=A-f+1;A=Math.min(f,A);0===A&&c(r)})};c.settle=function(a){return v(l.call(a,function(a){function c(){return a.inspect()}a=n(a);return a.then(c,c)}))};c.map=function(a,c,e){return v(l.call(a,function(a){return n(a).then(c,e)}))};c.reduce=function(a,c){function e(a,h,f){return n(a).then(function(a){return n(h).then(function(e){return c(a,e,f)})})}return 2<arguments.length?f.call(a,e,arguments[2]):f.call(a,e)};c.reduceRight=
function(c,e){function f(a,c,h){return n(a).then(function(a){return n(c).then(function(c){return e(a,c,h)})})}return 2<arguments.length?a.call(c,f,arguments[2]):a.call(c,f)};c.prototype.spread=function(a){return this.then(v).then(function(c){return a.apply(void 0,c)})};return c}})})("function"===typeof define&&define.amd?define:function(c){module.exports=c()});
(function(c){c("qowtRoot/third_party/when/lib/fatal",["require","./timer"],function(c){var l=c("./timer").set;return function(c){l(function(){throw c;},0)}})})("function"===typeof define&&define.amd?define:function(c){module.exports=c(require)});
(function(c){c("qowtRoot/third_party/when/lib/flow",["require","./fatal"],function(c){function l(){throw new TypeError("catch predicate must be a function");}function f(a,c){return function(){a.call(this);return c}}function a(){}var e=c("./fatal");return function(c){function k(a,c){return function(e){return(c===Error||null!=c&&c.prototype instanceof Error?e instanceof c:c(e))?a.call(this,e):p(e)}}var h=c.resolve,p=c.reject,y=c.prototype["catch"];c.prototype.done=function(c,e){var h=this._handler;
h.when(this._maybeFatal,a,this,h.receiver,c,e)};c.prototype._maybeFatal=function(a){if(Object(a)===a)h(a)["catch"](this._fatal)};c.prototype._fatal=e;c.prototype["catch"]=c.prototype.otherwise=function(a){return 1===arguments.length?y.call(this,a):"function"!==typeof a?this.ensure(l):y.call(this,k(arguments[1],a))};c.prototype["finally"]=c.prototype.ensure=function(a){if("function"!==typeof a)return this;a=f(a,this);return this.then(a,a)};c.prototype["else"]=c.prototype.orElse=function(a){return this.then(void 0,
function(){return a})};c.prototype.yield=function(a){return this.then(function(){return a})};c.prototype.tap=function(a){return this.then(a).yield(this)};return c}})})("function"===typeof define&&define.amd?define:function(c){module.exports=c(require)});(function(c){c("qowtRoot/third_party/when/lib/inspect",[],function(){return function(c){c.prototype.inspect=function(){return this._handler.inspect()};return c}})})("function"===typeof define&&define.amd?define:function(c){module.exports=c()});
(function(c){c("qowtRoot/third_party/when/lib/iterate",[],function(){return function(c){function l(c,f,k,h){function p(h){return a(k(h)).then(function(){return l(c,f,k,c(h))})}return a(h).then(function(c){return a(f(c)).then(function(a){return a?c:p(c)})})}function f(c,n,k,h){function l(h,p){return a(k(h)).then(function(){return f(c,n,k,p)})}return a(h).then(function(h){return a(n(h)).then(function(f){return f?h:a(c(h)).spread(l)})})}var a=c.resolve;c.iterate=l;c.unfold=f;return c}})})("function"===
typeof define&&define.amd?define:function(c){module.exports=c()});(function(c){c("qowtRoot/third_party/when/lib/progress",[],function(){return function(c){c.prototype.progress=function(c){return this.then(void 0,void 0,c)};return c}})})("function"===typeof define&&define.amd?define:function(c){module.exports=c()});
(function(c){c("qowtRoot/third_party/when/lib/with",[],function(){return function(c){c.prototype["with"]=c.prototype.withThis=c.prototype._bindContext;return c}})})("function"===typeof define&&define.amd?define:function(c){module.exports=c()});
(function(c){c("qowtRoot/third_party/when/lib/makePromise",[],function(){return function(c){function l(a){var c=this;this._handler=new x;f(a,function(a){c._handler.resolve(a)},function(a){c._handler.reject(a)},function(a){c._handler.notify(a)})}function f(a,c,e,h){try{a(c,e,h)}catch(f){e(f)}}function a(a){return new e(new N(new E(a)))}function e(a){this._handler=a}function n(a,c){if(a instanceof l){var e=a._handler.join();return c===e?new E(new TypeError("Promise cycle")):e}return ca(a)?h(a):new A(a)}
function v(a){return a instanceof l?a._handler.join():h(a)}function h(a){try{var c=a.then;return"function"===typeof c?new z(c,a):new A(a)}catch(e){return new E(e)}}function p(){}function y(a){this.handler=a;if(this._isMonitored()){var c=this._env.promiseMonitor.captureStack();this.trace=a._addTrace(c)}}function x(a){this.consumers=[];this.receiver=a;this.handler=void 0;this.resolved=!1;this._isMonitored()&&(this.trace=this._env.promiseMonitor.captureStack())}function N(a){y.call(this,a)}function G(a,
c){y.call(this,a);this.receiver=c}function z(a,c){x.call(this);this.assimilated=!1;this.untrustedThen=a;this.thenable=c}function A(a){this.value=a}function E(a){this.value=a;this.observed=!1;this._isMonitored()&&(this.key=this._env.promiseMonitor.startTrace(a))}function r(){return{state:"pending"}}function H(a,c,e,h,f,n,k,l){this.a=a;this.b=c;this.c=e;this.d=h;this.e=f;this.f=n;this.g=k;this.handler=l}function Q(a,c){this.q=a;this.value=c}function ca(a){return("object"===typeof a||"function"===typeof a)&&
null!==a}function da(c,e,h){try{return c.call(h,e)}catch(f){return a(f)}}function F(){}var ta,t=c.scheduler,U=Object.create||function(a){function c(){}c.prototype=a;return new c};l.resolve=function(a){return a instanceof l?a:new e(new N(n(a)))};l.reject=a;l.never=function(){return ta};l._defer=function(){return new e(new x)};l.prototype.then=function(a,c,h){var f=this._handler,n=new x(f.receiver);f.when(n.resolve,n.notify,n,f.receiver,a,c,h);return new e(n)};l.prototype["catch"]=l.prototype.otherwise=
function(a){return this.then(void 0,a)};l.prototype._bindContext=function(a){return new e(new G(this._handler,a))};l.all=function(a){function c(a,e,h,f){h.when(F,F,void 0,a,function(a){e[f]=a;0===--n&&this.resolve(e)},a.reject,a.notify)}var h=new x,f=a.length>>>0,n=f,k=[],l,t;for(l=0;l<f;++l)l in a?(t=a[l],ca(t)?c(h,k,v(t),l):(k[l]=t,--n)):--n;0===n&&h.resolve(k);return new e(h)};l.race=function(a){if(Object(a)===a&&0===a.length)return ta;for(var c=new x,h=0;h<a.length;++h)n(a[h]).when(F,F,void 0,
c,c.resolve,c.reject);return new e(c)};e.prototype=U(l.prototype);p.prototype.inspect=r;p.prototype.when=F;p.prototype.resolve=F;p.prototype.reject=F;p.prototype.notify=F;p.prototype.join=function(){return this};p.prototype._env=c.monitor||l;p.prototype._addTrace=F;p.prototype._isMonitored=function(){return"undefined"!==typeof this._env.promiseMonitor};y.prototype=U(p.prototype);y.prototype.join=function(){return this.handler.join()};y.prototype.inspect=function(){return this.handler.inspect()};y.prototype._addTrace=
function(a){return this.handler._addTrace(a)};x.prototype=U(p.prototype);x.prototype.inspect=function(){return this.resolved?this.handler.join().inspect():r()};x.prototype.resolve=function(a){this._join(n(a,this))};x.prototype.reject=function(a){this._join(new E(a))};x.prototype.join=function(){return this.resolved?this.handler.join():this};x.prototype.run=function(){var a=this.consumers,c=this.handler=this.handler.join();this.consumers=void 0;for(var e=0;e<a.length;e+=7)c.when(a[e],a[e+1],a[e+2],
a[e+3],a[e+4],a[e+5],a[e+6])};x.prototype._join=function(a){this.resolved||(this.resolved=!0,this.handler=a,t.enqueue(this),this._isMonitored()&&(this.trace=a._addTrace(this.trace)))};x.prototype.when=function(a,c,e,h,f,n,k){this.resolved?t.enqueue(new H(a,c,e,h,f,n,k,this.handler.join())):this.consumers.push(a,c,e,h,f,n,k)};x.prototype.notify=function(a){this.resolved||t.enqueue(new Q(this.consumers,a))};x.prototype._addTrace=function(a){return this.resolved?this.handler._addTrace(a):a};N.prototype=
U(y.prototype);N.prototype.when=function(a,c,e,h,f,n,k){t.enqueue(new H(a,c,e,h,f,n,k,this.join()))};G.prototype=U(y.prototype);G.prototype.when=function(a,c,e,h,f,n,k){void 0!==this.receiver&&(h=this.receiver);this.join().when(a,c,e,h,f,n,k)};z.prototype=U(x.prototype);z.prototype.when=function(a,c,e,h,f,n,k){this.assimilated||(this.assimilated=!0,this._assimilate());x.prototype.when.call(this,a,c,e,h,f,n,k)};z.prototype._assimilate=function(){var a=this;this._try(this.untrustedThen,this.thenable,
function(c){a.resolve(c)},function(c){a.reject(c)},function(c){a.notify(c)})};z.prototype._try=function(a,c,e,h,f){try{a.call(c,e,h,f)}catch(n){h(n)}};A.prototype=U(p.prototype);A.prototype.inspect=function(){return{state:"fulfilled",value:this.value}};A.prototype.when=function(a,c,e,h,f){c="function"===typeof f?da(f,this.value,h):this.value;a.call(e,c)};E.prototype=U(p.prototype);E.prototype.inspect=function(){return{state:"rejected",reason:this.value}};E.prototype.when=function(c,e,h,f,n,k){this._isMonitored()&&
!this.observed&&this._env.promiseMonitor.removeTrace(this.key);this.observed=!0;e="function"===typeof k?da(k,this.value,f):a(this.value);c.call(h,e)};E.prototype._addTrace=function(a){this.observed||this._env.promiseMonitor.updateTrace(this.key,a)};ta=new e(new p);H.prototype.run=function(){this.handler.when(this.a,this.b,this.c,this.d,this.e,this.f,this.g)};Q.prototype.run=function(){for(var a=this.q,c=1;c<a.length;c+=7)this._notify(a[c],a[c+1],a[c+2],a[c+5])};Q.prototype._notify=function(a,c,e,
h){var f;if("function"===typeof h)try{f=h.call(e,this.value)}catch(n){f=n}else f=this.value;a.call(c,f)};return l}})})("function"===typeof define&&define.amd?define:function(c){module.exports=c()});
(function(c){c("qowtRoot/third_party/when/lib/Queue",[],function(){function c(k){this.head=this.tail=this.length=0;this.buffer=Array(1<<k)}c.prototype.push=function(c){this.length===this.buffer.length&&this._ensureCapacity(2*this.length);this.buffer[this.tail]=c;this.tail=this.tail+1&this.buffer.length-1;++this.length;return this.length};c.prototype.shift=function(){var c=this.buffer[this.head];this.buffer[this.head]=void 0;this.head=this.head+1&this.buffer.length-1;--this.length;return c};c.prototype._ensureCapacity=
function(c){var f=this.head,a=this.buffer,e=Array(c),n=0,k;if(0===f)for(k=this.length;n<k;++n)e[n]=a[n];else{c=a.length;for(k=this.tail;f<c;++n,++f)e[n]=a[f];for(f=0;f<k;++n,++f)e[n]=a[f]}this.buffer=e;this.head=0;this.tail=this.length};return c})})("function"===typeof define&&define.amd?define:function(c){module.exports=c()});
(function(c){c("qowtRoot/third_party/when/lib/scheduler",["require","./Queue"],function(c){function l(a){this._enqueue=a;this._handlerQueue=new f(15);var c=this;this.drainQueue=function(){c._drainQueue()}}var f=c("./Queue");l.prototype.enqueue=function(a){1===this._handlerQueue.push(a)&&this._enqueue(this.drainQueue)};l.prototype._drainQueue=function(){for(var a=this._handlerQueue;0<a.length;)a.shift().run()};return l})})("function"===typeof define&&define.amd?define:function(c){module.exports=c(require)});
(function(c){c("qowtRoot/third_party/when/lib/async",["require"],function(c){var l;return"undefined"!==typeof process&&null!==process&&"function"===typeof process.nextTick?function(c){process.nextTick(c)}:(l="function"===typeof MutationObserver&&MutationObserver||"function"===typeof WebKitMutationObserver&&WebKitMutationObserver)?function(c,a){var e,n=c.createElement("div");(new a(function(){var a=e;e=void 0;a()})).observe(n,{attributes:!0});return function(a){e=a;n.setAttribute("class","x")}}(document,
l):function(c){var a=setTimeout;return function(c){a(c,0)}}(c)})})("function"===typeof define&&define.amd?define:function(c){module.exports=c(require)});(function(c){c("qowtRoot/third_party/when/lib/Promise",["require","./makePromise","./scheduler","./async"],function(c){var l=c("./makePromise"),f=c("./scheduler");c=c("./async");return l({scheduler:new f(c),monitor:"undefined"!==typeof console?console:void 0})})})("function"===typeof define&&define.amd?define:function(c){module.exports=c(require)});
(function(c){c("qowtRoot/third_party/when/when","require ./lib/timer ./lib/timed ./lib/array ./lib/flow ./lib/inspect ./lib/iterate ./lib/progress ./lib/with ./lib/Promise".split(" "),function(c){function l(a,c,e,h){var f=E(a);return 2>arguments.length?f:f.then(c,e,h)}function f(a){return function(){return e(a,this,r.call(arguments))}}function a(a){return e(a,this,r.call(arguments,1))}function e(a,c,e){return A.all(e).then(function(e){return a.apply(c,e)})}function n(){function a(c){h._handler.resolve(c)}
function c(a){h._handler.reject(a)}function e(a){h._handler.notify(a)}var h=A._defer();this.promise=h;this.resolve=a;this.reject=c;this.notify=e;this.resolver={resolve:a,reject:c,notify:e}}var v=c("./lib/timer"),h=c("./lib/timed"),p=c("./lib/array"),y=c("./lib/flow"),x=c("./lib/inspect"),N=c("./lib/iterate"),G=c("./lib/progress"),z=c("./lib/with"),A=c("./lib/Promise"),A=[p,y,N,G,x,z].reduceRight(function(a,c){return c(a)},h(v.set,v.clear,A)),E=A.resolve,r=Array.prototype.slice;l.promise=function(a){return new A(a)};
l.resolve=A.resolve;l.reject=A.reject;l.lift=f;l["try"]=a;l.attempt=a;l.iterate=A.iterate;l.unfold=A.unfold;l.join=function(){return A.all(arguments)};l.all=function(a){return l(a,A.all)};l.settle=function(a){return l(a,A.settle)};l.any=f(A.any);l.some=f(A.some);l.map=function(a,c){return l(a,function(a){return A.map(a,c)})};l.reduce=function(a,c){var e=r.call(arguments,1);return l(a,function(a){e.unshift(a);return A.reduce.apply(A,e)})};l.reduceRight=function(a,c){var e=r.call(arguments,1);return l(a,
function(a){e.unshift(a);return A.reduceRight.apply(A,e)})};l.isPromiseLike=function(a){return a&&"function"===typeof a.then};l.Promise=A;l.defer=function(){return new n};return l})})("function"===typeof define&&define.amd?define:function(c){module.exports=c(require)});
define("qowtRoot/messageBus/messageBusImpl",["qowtRoot/utils/typeUtils","qowtRoot/configs/common","qowtRoot/third_party/when/when"],function(c,k,l){var f=function(a){this.myWin_=a||window;this.pendingConnections_=[];this.acceptedConnections_=[];this.completedConnections_=[];this.acknowledgements_=[];this.listeners_=[];this.msgQueue_=[];this.pendingMsgs_=[];this.myWin_.addEventListener("message",this.handleIncomingMessage_.bind(this),!1)};f.prototype=Object.create(Object.prototype);f.prototype.constructor=
f;f.prototype.connect=function(a,e){if(!a||null===a||!c.isObject(a)||!a.postMessage)throw Error("MessageBus: A valid HTML window object has not been provided to connect()");if(a===this.myWin_)throw Error("MessageBus: Trying to connect to its own window");if(e&&!c.isFunction(e))throw Error("MessageBus: The provided callback function is not of the correct type");for(var f=this.pendingConnections_.length,n=0;n<f;n++)if(this.pendingConnections_[n].win===a)throw Error("MessageBus: Trying to connect to a window that we are already trying to connect to");
f=this.acceptedConnections_.length;for(n=0;n<f;n++)if(this.acceptedConnections_[n].win===a)throw Error("MessageBus: Trying to connect to a window that we are already trying to connect to");f=this.completedConnections_.length;for(n=0;n<f;n++)if(this.completedConnections_[n].win===a)throw Error("MessageBus: Trying to connect to a window that has already been connected");f={win:a,callback:e,currentWaitTime:0,deferred:l.defer()};this.pendingConnections_.push(f);this.tryToConnect_(f);return f.deferred.promise};
f.prototype.pushMessage=function(e){if(!c.isObject(e))throw Error("MessageBus: A valid message object has not been provided to pushMessage()");var f=this.completedConnections_.length;if(0===f)this.pendingMsgs_.push(e);else{if(!c.isObject(e))throw Error("Cannot mark non-object value as quickoffice message");e.qoMessageBus=!0;this.msgQueue_.length>=a&&this.msgQueue_.shift();this.msgQueue_.push(e);for(var n=0;n<f;n++)this.completedConnections_[n].win.postMessage(e,"*")}};f.prototype.listen=function(a,
e){if(!c.isFunction(a))throw Error("MessageBus: A valid listener function has not been provided to listen()");if(e&&!c.isFunction(e))throw Error("MessageBus: The provided filter function is not of the correct type");this.listeners_.push({listener:a,filter:e})};f.prototype.stopListening=function(a){if(!c.isFunction(a))throw Error("MessageBus: A valid listener function has not been provided to stopListening()");for(var e=this.listeners_.length,f=0;f<e;f++)if(this.listeners_[f].listener===a){this.listeners_.splice(f,
1);break}};f.prototype.isConnectedTo=function(a){for(var c=!1,e=this.completedConnections_.length,f=0;f<e;f++)if(a===this.completedConnections_[f].win){c=!0;break}return c};f.prototype.tryToConnect_=function(a){a.currentWaitTime>k.kMESSAGE_BUS_CONNECTION_TIMEOUT?this.handleTimeOut_(a):(a.currentWaitTime+=k.kMESSAGE_BUS_CONNECTION_RETRY,-1!==this.pendingConnections_.indexOf(a)&&a.win.postMessage(e,"*"),a.timeoutId=setTimeout(this.tryToConnect_.bind(this,a),k.kMESSAGE_BUS_CONNECTION_RETRY))};f.prototype.handleTimeOut_=
function(a){var c=k.kMESSAGE_BUS_CONNECTION_TIMEOUT_MSG;window.connectFromAppToQowt&&(c=window.connectFromQowtToApp?Math.abs(Math.round(window.connectFromQowtToApp-window.connectFromAppToQowt)/1E3)>Math.round(k.kMESSAGE_BUS_CONNECTION_TIMEOUT/1E3*.8)?c+":qowt too late to connect":c+":qowt and app connected:handshake failed?":c+":qowt failed to connect");a.deferred.reject(Error(c))};f.prototype.handleIncomingMessage_=function(a){if(a){if(-1!==this.msgQueue_.indexOf(a.data))throw Error("MessageBus: A message that was pushed onto thisbus has arrived back on it - we have a circular dependancy!");
a.data===e?this.handleConnectionRequestMsg_(a):a.data===n?this.handleConnectionAcceptedMsg_(a):a.data===v?this.handleConnectionAckMsg_(a):a&&a.data&&!0===a.data.qoMessageBus&&("chrome-extension://gbkeegbaiigmenfmjfclcdgdpimamgkj"===a.origin||"chrome-extension://bpmcpldpdmajfigpchkicefoigmkfalc"===a.origin||"chrome-extension://ehibbfinohgbchlgdbfpikodjaojhccn"===a.origin)&&this.handleClientMsg_(a)}};f.prototype.handleConnectionRequestMsg_=function(a){if(!a.source)throw Error("MessageBus: Unknown source of qoConnectionRequest message");
a.source.postMessage(n,"*")};f.prototype.handleConnectionAcceptedMsg_=function(a){if(!a.source)throw Error("MessageBus: Unknown source of qoConnectionAccepted message");for(var c=this.pendingConnections_.length,e=0;e<c;e++)if(this.pendingConnections_[e].win===a.source){c=this.pendingConnections_.splice(e,1)[0];a=this.acknowledgements_.indexOf(a.source);-1===a?this.acceptedConnections_.push(c):(this.acknowledgements_.splice(a,1),this.connectionCompleted_(c));c.win.postMessage(v,"*");break}};f.prototype.handleConnectionAckMsg_=
function(a){if(!a.source)throw Error("MessageBus: Unknown source of qoConnectionAck message");for(var c=this.acceptedConnections_.length,e=0;e<c;e++)if(this.acceptedConnections_[e].win===a.source){a=this.acceptedConnections_.splice(e,1)[0];this.connectionCompleted_(a);return}this.acknowledgements_.push(a.source)};f.prototype.handleClientMsg_=function(a){if(a.source){for(var c=this.listeners_.slice(),e=c.length,f=0;f<e;f++){var n=c[f];!n||n.filter&&!n.filter.call(this,a)||n.listener.call(this,a)}e=
this.completedConnections_.length;for(f=0;f<e;f++)this.completedConnections_[f].win!==a.source&&this.completedConnections_[f].win.postMessage(a.data,"*")}};f.prototype.connectionCompleted_=function(a){this.completedConnections_.push(a);clearTimeout(a.timeoutId);for(a.callback&&a.callback.call(this);0<this.pendingMsgs_.length;)this.pushMessage(this.pendingMsgs_.shift());a.deferred.resolve()};var a=10,e="qoConnectionRequest",n="qoConnectionAccepted",v="qoConnectionAck";return f});
define("qowtRoot/messageBus/messageBus",["qowtRoot/messageBus/messageBusImpl"],function(c){return new c});
define("qowtRoot/pubsub/pubsub",["third_party/lo-dash/lo-dash.min"],function(){function c(a,c){var f=[],n=[],l=[],G=[];e[a]&&e[a].length&&(v++,e[a].forEach(function(a){a.config.after?n.push(a):f.push(a);a.config.once&&G.push(a)}),f.concat(n).forEach(function(e){l.push(e.callback(a,c))}),G.forEach(function(a){k(a.token)}));return Promise.all(l)}function k(a){var c;_.values(e).some(function(e){return e.some(function(f,n){return f.token===a?(c=e.splice(n,1)[0],!0):!1})});return c}function l(a){var c=
0;return c=a?e[a]?e[a].length:0:_.values(e).reduce(function(a,c){return a+c.length},0)}function f(){e={}}var a=Object.create(Object.prototype,{subscriberCount:{get:function(){return l()}},registeredSignals:{get:function(){return _.keys(e)}},publishCount:{get:function(){return v}}});a.subscribe=function(a,c,f){if(!_.isString(a)||!a)throw new TypeError("invalid signal");if(!_.isFunction(c))throw new TypeError("invalid callback");f=f||{};f.once=!!f.once;f.after=!!f.after;var k=(++n).toString();e[a]=
e[a]||[];e[a].push({token:k,callback:c,config:f});return k};a.publish=function(a,e){if(!_.isString(a)||!a)throw new TypeError("invalid signal");e=e||{};return c(a,e)};a.doAction=function(a,e){if(!_.isString(a)||!a)throw new TypeError("invalid action");e=e||{};e=_.isString(e)?{contentType:e}:e;return c("qowt:doAction",{action:a,context:e})};a.unsubscribe=function(a){if(void 0!==a){if(!_.isString(a)||!a)throw new TypeError("invalid token");return k(a)}};a.subscriberCountForSignal=function(a){if(!_.isString(a)||
!a)throw new TypeError("invalid signal");return l(a)};a.clear=f;a.reset=function(){f();v=n=0};var e={},n=0,v=0;return a});(function(){var c={},k=window.sessionStorage.getItem("featureOverrides");k&&(c=JSON.parse(k));c.isRelease=!0;c.edit=!1;window.sessionStorage.setItem("featureOverrides",JSON.stringify(c));window.localStorage.removeItem("testsToInclude");window.localStorage.removeItem("builtInTests")})();define("configs/releaseFeatures",function(){});
(function(){var c={},k=window.sessionStorage.getItem("featureOverrides");k&&(c=JSON.parse(k));c.save=!!(window.chrome&&window.chrome.fileSystem&&window.chrome.fileSystem.chooseEntry);window.sessionStorage.setItem("featureOverrides",JSON.stringify(c))})();define("configs/chromeFeatures",function(){});define("qowtRoot/features/pack",[],function(){return{edit:!0,save:!1,pointEdit:!1,hats:!0}});
define("qowtRoot/features/utils",["qowtRoot/features/pack"],function(c){var k={isEnabled:function(f){f=c[f];return void 0===f?!1:f},enable:function(f){c[f]=!0},disable:function(f){c[f]=!1},setOverrides:function(f){for(var a in f)f.hasOwnProperty(a)&&(c[a]=f[a])},isDebug:function(){return void 0!==l?l:!k.isEnabled("isRelease")},setDebugOverride:function(c){l=c},clearDebugOverride:function(){l=void 0}},l;return k});
define("qowtRoot/utils/promiseUtils",["qowtRoot/utils/typeUtils","qowtRoot/third_party/when/when"],function(c,k){var l={cast:function(c){return c instanceof Promise?c:Promise.resolve(c)},delay:function(c,a){c=c||0;return new Promise(function(e){setTimeout(e.bind(void 0,a),c)})},delayThenReject:function(c,a){c=c||0;return new Promise(function(e,n){setTimeout(n.bind(e,a),c)})},throwAndEscapeChain:function(c){c instanceof Error||(console.error("throwAndEscapeChain wrapping value in new Error: ",c),c=
Error(c));k.reject(c).done();throw c;},pipeline:function(f){function a(){for(var n=Array.prototype.slice.call(arguments,0);0<f.length;){var h=f.shift();if(c.isPromiseLike(h))return l.cast(h).then(function(c){f.unshift(c);return a.apply(e,n)});c.checkArgTypes("PromiseUtils.pipeline",{task:[h,"function"]});h=h.apply(e,n);if(c.isPromiseLike(h))return l.cast(h).then(function(c){return a(c)});n=[h]}return n[0]}var e=this,n=Array.prototype.slice.call(arguments,0);if(n.some(c.isPromiseLike))return Promise.all(n).then(function(a){return l.pipeline.apply(e,
a)});c.checkArgTypes("PromiseUtils.pipeline",{tasks:[f,"list"]});f=f.slice(0);return a.apply(e,n.slice(1))},finally:function(c,a){function e(){return l.cast(a()).then(function(){return c})}return l.cast(c).then(e,e)},waitForNextMacroTurn:function(c){return new Promise(function(a){window.setTimeout(a.bind(null,c),0)})}};return l});
define("utils/analytics/googleAnalytics",["qowtRoot/features/utils","qowtRoot/utils/promiseUtils"],function(c,k){function l(a,e){var h;void 0!==A?h=A?Promise.resolve():Promise.reject(Error("ga permission cached (not permitted)")):(window.analytics&&chrome&&chrome.metricsPrivate&&chrome.metricsPrivate.getIsCrashReportingEnabled&&(!c.isDebug()||void 0!==window.__gaMock)?h=Promise.resolve():(console.warn("GA not supported on this platform"),h=Promise.reject(Error("GA not supported on this platform"))),
h=h.then(f).catch(n));return h.then(v).then(a.bind(null,e)).catch(function(){})}function f(){var c=Error("Crash reporting setting timed out");return Promise.race([a(),k.delayThenReject(1E3,c)]).then(e)}function a(){return new Promise(function(a){chrome.metricsPrivate.getIsCrashReportingEnabled(a)})}function e(a){return new Promise(function(c,e){E=window.analytics.getService(G);E.getConfig().addCallback(function(f){f.setTrackingPermitted(a);(A=a)?c():(console.warn("Crash reporting not allowed"),e())})})}
function n(){A=!1;return Promise.reject()}function v(){void 0===r&&h("QO");return Promise.resolve()}function h(a){r&&r.sendAppView(a);r=E.getTracker(N[a]);H&&r.set(window.analytics.Parameters.SESSION_GROUP,H);"QO"!==a&&Q&&r.set(window.analytics.Parameters.APP_ID,Q);r.forceSessionStart();return Promise.resolve()}function p(a){z!==a&&(z=a,r.sendAppView(a));return Promise.resolve()}function y(a){r.sendException(a.msg,a.fatal);return Promise.resolve()}function x(a){r.sendEvent(a.category,a.action,a.label,
a.value);return Promise.resolve()}var N={word:"UA-44583639-1",sheet:"UA-44583639-2",point:"UA-44583639-3",QO:"UA-44583639-4"},G="Quickoffice",z,A,E,r,H,Q;return{setFileExt:function(a){Q=a},setSessionGroup:function(a){H=a},setTracker:function(a){return l(h,a)},sendState:function(a){return l(p,a)},sendException:function(a){return l(y,a)},sendEvent:function(a){return l(x,a)},reset:function(){r=E=A=z=void 0}}});
define("qowtRoot/utils/i18n",["qowtRoot/utils/typeUtils","utils/analytics/googleAnalytics"],function(c,k){var l={getMessage:function(f,a){var e="????";if(!chrome||!chrome.i18n)return f;c.isString(f)?(e=chrome.i18n.getMessage(f,a),e||(e=f,l.logError_("Missing translation",f))):l.logError_("Invalid string translation Id",f);return e},logError_:function(c,a){console.error(c+" "+a);k.sendException({msg:c,fatal:!1})}};return l});
define("qowtRoot/errors/localisedError",["qowtRoot/utils/typeUtils","qowtRoot/utils/i18n","third_party/lo-dash/lo-dash.min"],function(c,k){var l=function(f){f=f||"";this.name="LocalisedError";c.isObject(f)&&_.extend(this,f);this.message=(this.code?this.code+": ":"")+(this.message||JSON.stringify(f)||this.title||this.details||this.additionalInfo);this.title=k.getMessage(this.title);this.details=f.fileName?k.getMessage(this.details,f.fileName):k.getMessage(this.details);this.linkData&&this.linkData.msg&&
(this.linkData.msg=k.getMessage(this.linkData.msg)||this.linkData.msg);Error.captureStackTrace(this,l)};l.prototype=Object.create(Error.prototype);return l.prototype.constructor=l});define("qowtRoot/errors/qowtError",["qowtRoot/errors/localisedError"],function(c){var k=function(){c.apply(this,arguments);this.name="QOWTError";Error.captureStackTrace(this,k);this.fatal=!1};k.prototype=Object.create(c.prototype);k.prototype.constructor=k;return window.QOWTError=k});
define("qowtRoot/errors/qowtSilentError",["qowtRoot/errors/localisedError"],function(c){var k=function(){c.apply(this,arguments);this.name="QOWTSilentError";Error.captureStackTrace(this,k);this.fatal=!1;this.silent=!0};k.prototype=Object.create(c.prototype);k.prototype.constructor=k;return window.QOWTSilentError=k});
define("qowtRoot/errors/qowtException",["qowtRoot/errors/localisedError"],function(c){var k=function(){c.apply(this,arguments);this.name="QOWTException";Error.captureStackTrace(this,k);this.fatal=!0};k.prototype=Object.create(c.prototype);k.prototype.constructor=k;return window.QOWTException=k});
define("qowtRoot/errors/errorCatcher","qowtRoot/utils/typeUtils qowtRoot/messageBus/messageBus qowtRoot/pubsub/pubsub qowtRoot/errors/qowtError qowtRoot/errors/qowtSilentError qowtRoot/errors/qowtException".split(" "),function(c,k,l,f,a,e){function n(a){a.error?(console.error("%s caught js exception: %s",z,a.error.name||a.error.message?a.error.name+": "+a.error.message:a.error),console.error(a.error.stack),void 0===a.error.fatal&&(a.error.fatal=!0),h(a.error)):console.error(a)}function v(a,c){console.log("%s caught deprecated error",
z);console.log(c);c.isDeprecatedError=!0;h(c)}function h(h){if(h instanceof Error)void 0===h.fatal&&(h.fatal=!0);else{console.log("%s converting deprecated/bad error",z);switch(!0){case c.isObject(h)&&h.isDeprecatedError:var n={title:h.errorId?h.errorId+"_short_msg":void 0,details:h.errorId?h.errorId+"_msg":void 0,linkData:h.linkData,message:h.additionalInfo};h=h.fatal?new e(n):h.silent?new a(n):new f(n);break;case c.isNumber(h):h=new e({code:h});break;case c.isString(h):h=new e(h);break;default:h=
new e(h.toString())}h.stack=void 0}E.push(h);p(h);if(!h.isSynced){console.log("%s pushing error to msg bus",z);n=_.extend({},h);n.name=h.name;n.message=h.message;n.stack=h.stack;try{k.pushMessage({id:N,error:JSON.stringify(n)})}catch(l){}}}function p(a){console.log("%s dispatching error to observers",z);G.forEach(function(c){try{c.call(c,a)}catch(e){console.warn("Error observer %s threw an exception; ignored",c.name||""),console.warn(e.stack)}})}function y(a){if(a&&a.data&&a.data.error){console.log("%s receiving error from msg bus",
z);a=JSON.parse(a.data.error);var c={};-1!=="Error EvalError RangeError ReferenceError SyntaxError TypeError URIError QOWTError QOWTSilentError QOWTException".split(" ").indexOf(a.name)?(console.log("cast to %s",a.name),c=new window[a.name]):(console.log("cast fallback to Error"),c=Error());_.extend(c,a);void 0===a.stack&&(c.stack=void 0);a=c;a.isSynced=!0;h(a)}}function x(a){return a&&a.data&&a.data.id===N}var N="errorSync",G=[],z="sandbox"===window.name?"QOWT":"App",A,E=[];return{init:function(){A=
l.subscribe("qowt:error",v);window.addEventListener("error",n);k.listen(y,x);Error.stackTraceLimit=Infinity},reset:function(){l.unsubscribe(A);window.removeEventListener("error",n);k.stopListening(y);G=[]},handleError:function(a){h(a)},addObserver:function(a){c.isFunction(a)?G.push(a):console.warn("Error observer must be a function")},observers:function(){return G},lastError:function(){return E[E.length-1]}}});
define("qowtRoot/errors/unique/fileDoesNotExistError",["qowtRoot/errors/qowtException"],function(c){var k=function(){this.title="file_does_not_exist_error_title";this.details="file_does_not_exist_error_details";this.gaState="FileDoesNotExistError";c.apply(this,arguments);this.name="FileDoesNotExistError";Error.captureStackTrace(this,k)};k.prototype=Object.create(c.prototype);return k.prototype.constructor=k});
define("qowtRoot/utils/tryUtils",["qowtRoot/utils/typeUtils"],function(c){var k=function(c){this.rethrowOnException=!1;this.optMsg=c};k.prototype={__proto__:Object.prototype,ignore:function(){return this.run.apply(this,arguments)},rethrow:function(){this.rethrowOnException=!0;return this.run.apply(this,arguments)},run:function(){var k=arguments[0],f=[].splice.call(arguments,1);try{return k.apply(null,f)}catch(a){this.optMsg&&(c.isString(this.optMsg)?console.warn(this.optMsg):console.dir(this.optMsg));
if(this.rethrowOnException){if(a instanceof Error)throw a;throw Error(a);}console.warn("Ignoring exception: ",a)}}};return{withWarning:function(c){return new k(c)},ignore:function(){if(!c.isFunction(arguments[0]))throw Error("ignore must be passed a function as first argument");var l=new k;return l.ignore.apply(l,arguments)},rethrow:function(){var c=new k;return c.rethrow.apply(c,arguments)}}});
define("controllers/appState",["qowtRoot/errors/errorCatcher","utils/analytics/googleAnalytics"],function(c,k){function l(a){f.updateState(a.gaState?a.gaState:a.fatal?"FatalCrash":"NonFatalError",{data_reason:a.message,data_fatal:a.fatal})}var f={init:function(){c.addObserver(l);f.updateState("Init")},setApp:function(a,c){k.setFileExt(c);k.setTracker(a)},updateState:function(c,f){a!==c&&(a=c,window.qowtState={state:a,context:f},k.sendState(a))}},a;return f});
define("utils/converter",[],function(){var c={app2Icon:function(c){return{word:"../img/doc.ico",sheet:"../img/xls.ico",point:"../img/ppt.ico"}[(c||"").toLowerCase()]},extension2Format:function(c){return{doc:"CBF",docx:"OOXML",docm:"OOXML",dot:"CBF",dotx:"OOXML",xls:"CBF",xlsx:"OOXML",xlsm:"OOXML",xlt:"CBF",xltx:"OOXML",csv:"CSV",ppt:"CBF",pptx:"OOXML",pptm:"OOXML",pot:"CBF",potx:"OOXML"}[(c||"").toLowerCase()]},extension2App:function(c){return{doc:"word",docx:"word",docm:"word",dot:"word",dotx:"word",
xls:"sheet",xlsx:"sheet",xlsm:"sheet",xlt:"sheet",xltx:"sheet",csv:"sheet",ppt:"point",pptx:"point",pptm:"point",pot:"point",potx:"point"}[(c||"").toLowerCase()]},extension2Mime:function(c){return{doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",docm:"application/vnd.ms-word.document.macroenabled.12",dot:"application/msword-template",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xls:"application/vnd.ms-excel",
xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlt:"application/vnd.ms-excel",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",csv:"text/csv",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",pot:"application/vnd.ms-powerpoint",potx:"application/vnd.openxmlformats-officedocument.presentationml.template"}[(c||
"").toLowerCase()]},app2FileName:function(c){return{word:"Document",point:"Presentation",sheet:"Spreadsheet"}[(c||"").toLowerCase()]},url2App:function(c){var f,a="";(c=(c||"").match(/.*\/([^\/?]*)/))&&(c=c[1].match(/.*\.([^\.]*)$/))&&(a=c[1]);switch(a.toLowerCase()){case "doc":case "docx":case "docm":f="word";break;case "xls":case "xlsx":case "xlsm":case "csv":f="sheet";break;case "ppt":case "pptx":case "pptm":f="point"}return f},mime2Extension:function(c){return k[(c||"").toLowerCase()]},mime2App:function(k){return c.extension2App(c.mime2Extension(k))},
mime2Icon:function(k){return c.app2Icon(c.mime2App(k))},mime2Format:function(k){return c.extension2Format(c.mime2Extension(k))},name2ext:function(c){var f="";(c=(c||"").match(/.*\.([^\.]*)$/))&&(f=c[1]);return f}},k={"application/msword":"doc","application/vnd.ms-word":"doc","application/vnd.msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.wordprocessing-openxml":"docx","application/vnd.ms-word.document.macroenabled.12":"docm","application/vnd.ms-word.document.12":"docm",
"application/vnd.openxmlformats":"docx","application/msword-template":"dot","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","application/mspowerpoint":"ppt","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.presentation-openxml":"pptx","application/vnd.presentation-openxmlm":"pptx","application/vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","application/vnd.openxmlformats-officedocument.presentationml.template":"potx",
"application/msexcel":"xls","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.spreadsheet-openxml":"xlsx","application/vnd.ms-excel.sheet.macroenabled.12":"xlsm","application/vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","text/csv":"csv"};return c});
define("qowtRoot/errors/unique/httpErrorFileNotFound",["qowtRoot/errors/qowtException"],function(c){var k=function(){this.title="temporary_unable_to_open_error_short_msg";this.details="temporary_unable_to_open_error_msg";this.gaState="HTTPErrorFileNotFound";c.apply(this,arguments);this.name="HTTPErrorFileNotFound";this.message="HTTP ERROR: 404";Error.captureStackTrace(this,k)};k.prototype=Object.create(c.prototype);return k.prototype.constructor=k});
define("qowtRoot/errors/unique/httpErrorZero",["qowtRoot/errors/qowtException"],function(c){var k=function(){this.title="http_error_zero_short_msg";this.details="http_error_zero_msg";this.gaState="HTTPErrorZero";c.apply(this,arguments);this.name="HTTPErrorZero";this.message="HTTP ERROR: 0";Error.captureStackTrace(this,k)};k.prototype=Object.create(c.prototype);return k.prototype.constructor=k});
define("qowtRoot/errors/unique/timeoutError",["qowtRoot/errors/qowtException"],function(c){var k=function(){this.gaState="TimeoutError";c.apply(this,arguments);this.name="TimeoutError";Error.captureStackTrace(this,k)};k.prototype=Object.create(c.prototype);return k.prototype.constructor=k});
define("utils/retryHandler",[],function(){var c=function(){this.interval=1E3;this.maxInterval=6E4};c.prototype={__proto__:Object.prototype,maxedOut:function(){return this.interval>this.maxInterval},retry:function(c){setTimeout(c,this.interval);this.interval=this.nextInterval_()},reset:function(){this.interval=1E3},nextInterval_:function(){var c=2*this.interval+this.getRandomInt_(0,1E3);return Math.min(c,this.maxInterval)},getRandomInt_:function(c,l){return Math.floor(Math.random()*(l-c+1)+c)}};return c});
define("utils/xhr","qowtRoot/errors/qowtException qowtRoot/errors/unique/httpErrorFileNotFound qowtRoot/errors/unique/httpErrorZero qowtRoot/errors/unique/timeoutError qowtRoot/utils/typeUtils qowtRoot/third_party/when/when utils/retryHandler".split(" "),function(c,k,l,f,a,e,n){var v=function(a){this.method_=a.method||"GET";this.responseType_=a.responseType||"blob";this.url_=this.buildUrl_(a.baseUrl,a.params);this.authToken_=a.authToken;this.contentType_=a.contentType;this.deferred_=e.defer();this.kEstimatedDownloadChunks_=
20;this.timeoutLength_=6E5;this.remainingChunks_=this.kEstimatedDownloadChunks_;this.progress_=0;this.retryHandler_=new n;a.abortPromise&&(a.abortPromise=a.abortPromise.catch(function(){this.xhr_&&this.xhr_.abort&&this.xhr_.abort();this.deferred_.reject(Error("XHR canceled"))}))};v.prototype={__proto__:Object.prototype,send:function(a){this.xhr_=this.createXMLHttpRequest_();this.xhr_.send(a);this.startConnectionTimeout_();return this.deferred_.promise},createXMLHttpRequest_:function(){var a=new XMLHttpRequest;
"GET"===this.method_?a.onprogress=this.onProgress_.bind(this):a.upload.onprogress=this.onProgress_.bind(this);a.onload=this.onSuccess_.bind(this);a.onerror=this.onError_.bind(this);a.open(this.method_,this.url_,!0);a.responseType=this.responseType_;this.authToken_&&a.setRequestHeader("Authorization","Bearer "+this.authToken_);this.contentType_&&a.setRequestHeader("Content-Type",this.contentType_);return a},onSuccess_:function(a){this.clearConnectionTimeout_();if(4===a.target.readyState){var c=a.target.response||
a.target.responseText;if(200!==a.target.status&&0!==a.target.status||!c)if(0!==a.target.status&&200!==a.target.status||c)this.onError_(a);else this.deferred_.reject("HTTP ERROR: ABORTED");else{if("json"===a.target.responseType&&"string"===typeof c)try{c=JSON.parse(c)}catch(e){return this.deferred_.reject(Error("XHR response not valid JSON"))}this.deferred_.notify(1);this.deferred_.resolve(c)}}},onProgress_:function(a){this.resetConnectionTimeout_();a&&a.lengthComputable?this.progress_=(a.position||
a.loaded)/(a.totalSize||a.total):(a=this.remainingChunks_/this.kEstimatedDownloadChunks_,this.remainingChunks_-=a,this.progress_+=a/this.kEstimatedDownloadChunks_);this.deferred_.notify(this.progress_)},onError_:function(a){a.target.status&&(500<=a.target.status||429===a.target.status)?this.retry_(a):this.deferred_.reject(this.getErrorFromXhrStatus_(a.target.status))},retry_:function(a){this.retryHandler_.maxedOut()?this.deferred_.reject(this.getErrorFromXhrStatus_(a.target.status)):this.retryHandler_.retry(this.send.bind(this))},
getErrorFromXhrStatus_:function(a){return 0===a?new l:404===a?new k:new c("HTTP ERROR: "+a)},buildUrl_:function(a,c){var e=this.parseUrl_(a),f=this.buildQuery_(c);f&&(e+="?"+f);return e},buildQuery_:function(a){a=a||{};return Object.keys(a).map(function(c){return encodeURIComponent(c)+"="+encodeURIComponent(a[c])}).join("&")},parseUrl_:function(c){if(a.isString(c)){var e=c;e.match(/^http[s]?:\/\//)||e.match(/^blob:/)||e.match(new RegExp("^"+window.location.origin))||(c="http://"+c)}else throw Error("URL for XHR should be a string");
return c},startConnectionTimeout_:function(){this.timeout_=window.setTimeout(function(){var a=new f("XHR timed out");this.deferred_.reject(a)}.bind(this),this.timeoutLength_)},clearConnectionTimeout_:function(){window.clearTimeout(this.timeout_);delete this.timeout_},resetConnectionTimeout_:function(){this.clearConnectionTimeout_();this.startConnectionTimeout_()}};return v});
define("qowtRoot/utils/localStorageManager",["qowtRoot/errors/qowtException"],function(c){return{setItem:function(k,l){try{window.localStorage.setItem(k,l)}catch(f){throw new c({title:"storage_quota_exceed_error_short_msg",details:"storage_quota_exceed_error_msg",message:f.message});}},getItem:function(c){return window.localStorage.getItem(c)}}});
define("ui/progressSpinner",["qowtRoot/features/utils"],function(c){function k(){p&&(p=!1,n.style.opacity="0")}function l(a,c){x[a].progress=1<c?1:0>c||void 0===c?0:c;var e=0,h=0,n=0,k;for(k in x)if(x.hasOwnProperty(k)&&void 0!==x[k].weight&&void 0!==x[k].progress){var l=x[k];"*"===l.weight?n=l.progress:(h+=l.weight,e+=l.progress*l.weight)}0<n&&(e+=n*(1-h));f(e)}function f(a){a=1<a?1:0>a||void 0===a?0:a;var c=parseInt(8*a,10);h&&h.getElementById("circular-progress").setAttribute("class",("editor"===
v?"dark":"light")+" p"+c);1===a&&setTimeout(k,100)}function a(){v=c.isEnabled("edit")?"editor":"viewer";n=document.createElement("div");n.style.display="none";n.classList.add(v);n.classList.add("progress-spinner-container");n.classList.add("fader");n.addEventListener("webkitTransitionEnd",function(){p||(f(0),n.style.display="none")},!1);e=document.createElement("embed");e.classList.add(v);e.classList.add("progress-spinner");e.src="../img/progressSpinner.svg";e.onload=function(){h=e.getSVGDocument()};
n.appendChild(e);var a=document.createElement("div");a.classList.add(v);a.classList.add("progress-spinner-label");a.textContent=chrome.i18n.getMessage("file_loading_spinner_label");n.appendChild(a);document.body.appendChild(n);N=!0}var e,n,v,h,p=!1,y=0,x={},N=!1;return{show:function(c){N||a();p||(p=!0,n.style.display="block",n.style.opacity="1");c&&f(c)},hide:function(){k()},setProgress:function(a){f(a)},addContributor:function(a){y++;var c="contrib"+y;x[c]={weight:a,progress:0};return l.bind(this,
c)},resetContributors:function(){x={};y=0}}});define("utils/htmlConstructor",[],function(){var c={constructHTML:function(k,l){for(var f=document.createDocumentFragment(),a=0;a<k.length;a++){var e=k[a];e.elType=e.elType||"div";var n=document.createElement(e.elType),v;for(v in e)e.hasOwnProperty(v)&&"function"!==typeof e[v]&&"children"!==v&&(n[v]=e[v]);e.children&&c.constructHTML(e.children,n);f.appendChild(n)}l&&l.appendChild(f);return f}};return c});
define("utils/pluginLoader","qowtRoot/errors/errorCatcher qowtRoot/errors/qowtException qowtRoot/errors/qowtSilentError qowtRoot/pubsub/pubsub qowtRoot/third_party/when/when qowtRoot/utils/localStorageManager qowtRoot/utils/typeUtils ui/progressSpinner utils/htmlConstructor".split(" "),function(c,k,l,f,a,e,n,v,h){var p=function(a){this.status="idle";this.myWin_=a||window;this.kHistoricId_="pluginLoadTimes";this.kHistoricCount_=10;this.relatedApp_=null;this.kPluginLoadRetryMax_=3;this.timeouts_=this.pluginLoadAttempt_=
0;this.timeout_=this.expectedLoadTime_=this.averageLoadTime_=this.historicLoadTimes_=this.startTime_=this.progressIntervalId_=this.spinnerUpdateFunc_=this.deferred_=null;this.pluginTimeoutLength_=3E4};p.prototype=Object.create(Object.prototype);p.prototype.constructor=p;p.prototype.loadPlugin=function(c){if("word"!==c&&"sheet"!==c&&"point"!==c)throw Error("Error: unknown app: "+c);this.deferred_=a.defer();this.status="loading";this.relatedApp_=c;this.constructPluginHTML_();return this.deferred_.promise};
p.prototype.constructPluginHTML_=function(){this.pluginLoadAttempt_++;var a=h.constructHTML([{id:"pluginContainer",children:[{elType:"embed",name:"nacl_module",id:"qonacl",width:0,height:0,src:"../plugin/"+this.relatedApp_+".nmf",type:"application/x-nacl"}]}]);this.setupLoadListeners_(a);this.startLoadTimeout_();this.beginLoading_(a)};p.prototype.setupLoadListeners_=function(a){a=a.getElementById("pluginContainer");a.addEventListener("load",this.pluginLoaded_.bind(this),!0);a.addEventListener("error",
this.handleNaclError_.bind(this),!0);a.addEventListener("crash",this.handleNaClCrash_.bind(this),!0);a.addEventListener("abort",this.handleNaClAbort_.bind(this),!0);a.addEventListener("loadstart",this.initProgressUpdate_.bind(this),!0);f.subscribe("app:naclCrash",this.handleNaClCrash_.bind(this))};p.prototype.beginLoading_=function(a){document.body.appendChild(a)};p.prototype.handleNaclTimeout_=function(){this.timeouts_++;this.logMessage_("Nacl loading timeout #"+this.timeouts_);this.startLoadTimeout_()};
p.prototype.handleNaClAbort_=function(){this.clearLoadTimeout_();this.deferred_.reject(Error("Nacl Loading Aborted"))};p.prototype.handleNaclError_=function(){this.logMessage_("NaCl-FAIL#"+this.pluginLoadAttempt_+":"+this.getLastError_());this.clearLoadTimeout_();if(this.pluginLoadAttempt_<this.kPluginLoadRetryMax_){var a=document.getElementById("pluginContainer");if(a&&a.parentNode)a.parentNode.removeChild(a);else throw Error("Cannot retry NaCl load. Unexpected state.");this.constructPluginHTML_()}else{var a=
this.getLastError_(),c;c=!(-1===a.indexOf("Data Execution Prevention is required")&&-1===a.indexOf("CPU model is not supported"));throw new k({title:"app_nacl_error_title",details:c?"app_nacl_error_unsupported_device":"app_nacl_error_load_failed",message:a});}};p.prototype.handleNaClCrash_=function(){this.clearLoadTimeout_();throw new k({title:"app_nacl_crash_title",details:"app_nacl_crash_msg",message:this.getLastError_()});};p.prototype.getLastError_=function(){var a=document.getElementById("qonacl");
return a?a.lastError:"NaCl error or crash: No lastError logged."};p.prototype.logMessage_=function(a){var e=new l(a);c.handleError(e);console.error(a)};p.prototype.updateProgress_=function(){this.spinnerUpdateFunc_(this.progressAlgo_((new Date-this.startTime_)/this.expectedLoadTime_))};p.prototype.initProgressUpdate_=function(){v.show();this.spinnerUpdateFunc_=v.addContributor("*");this.calcExpectedLoadTime_();this.progressIntervalId_=this.myWin_.setInterval(this.updateProgress_.bind(this),10)};p.prototype.calcExpectedLoadTime_=
function(){this.startTime_=new Date;this.historicLoadTimes_=JSON.parse(e.getItem(this.kHistoricId_));this.historicLoadTimes_ instanceof Array||(this.historicLoadTimes_=[]);if(0===this.historicLoadTimes_.length)this.averageLoadTime_=100;else{var a=0;this.historicLoadTimes_.forEach(function(c){a+=c});this.averageLoadTime_=a/this.historicLoadTimes_.length}this.expectedLoadTime_=1.1*this.averageLoadTime_};p.prototype.progressAlgo_=function(a){return Math.pow(a+(1-a)/2,16)};p.prototype.pluginLoaded_=function(){this.clearLoadTimeout_();
this.myWin_.clearInterval(this.progressIntervalId_);n.isFunction(this.spinnerUpdateFunc_)&&this.spinnerUpdateFunc_(1);this.recordLoadTime_();1<this.pluginLoadAttempt_&&this.logMessage_("NaCl Loaded OK: try#"+this.pluginLoadAttempt_);this.status="loaded";this.deferred_.resolve()};p.prototype.recordLoadTime_=function(){for(this.historicLoadTimes_.push(new Date-this.startTime_);this.historicLoadTimes_.length>this.kHistoricCount_;)this.historicLoadTimes_.shift();e.setItem(this.kHistoricId_,JSON.stringify(this.historicLoadTimes_))};
p.prototype.startLoadTimeout_=function(){this.timeout_=this.myWin_.setTimeout(this.handleNaclTimeout_.bind(this),this.pluginTimeoutLength_)};p.prototype.clearLoadTimeout_=function(){this.myWin_.clearTimeout(this.timeout_)};return p});
define("utils/fileWriter",["qowtRoot/third_party/when/when","utils/analytics/googleAnalytics"],function(c,k){var l=function(c){this.entry=c;this.state=0};l.prototype={__proto__:Object.prototype,writeData:function(c){return this.createWriter_().then(this.truncateAndWrite_.bind(this,c)).then(function(){return this.entry}.bind(this))},createWriter_:function(){var f=c.defer();c(0===this.state).then(function(){this.entry.createWriter(f.resolve,f.reject)}.bind(this));return f.promise},writeOrResolve_:function(c,
a,e){if(2===a.readyState)switch(this.state){case 3:try{this.state=1,a.write(c)}catch(n){e.reject(Error(n))}break;case 1:this.state=0,e.resolve()}else k.sendException({msg:"Callback for write/ writeend called when FileWriter.readyState !== DONE",fatal:!1})},truncateAndWrite_:function(f,a){return c.promise(function(c,n){1===a.readyState&&n(Error("INVALID_STATE_ERR : Cannot write when the previous write is still in progress"));a.onwrite=this.writeOrResolve_.bind(this,f,a,{reject:n,resolve:c});a.onerror=
function(a){n(Error(a.currentTarget.error.message))};try{this.state=3,a.truncate(0)}catch(k){throw Error(k);}}.bind(this))}};return l});
define("utils/metrics",["qowtRoot/features/utils","qowtRoot/utils/typeUtils"],function(c,k){var l,f="doc docx docm xls xlsx xlsm ppt pptx pptm pps ppsx ppsm csv".split(" "),a="csvNonEmptyCellCount csvSheetCount csvFormattedCellCount docPageCount docSectionCount docParagraphCount docxPageCount docxSectionCount docxParagraphCount pptSlideCount pptMasterCount pptxSlideCount pptxMasterCount xlsNonEmptyCellCount xlsSheetCount xlsFormattedCellCount xlsxNonEmptyCellCount xlsxSheetCount xlsxFormattedCellCount".split(" ");return{recordFileType:function(a){if(a){var n=
l=a.toLowerCase();if(chrome&&chrome.metricsPrivate&&chrome.metricsPrivate.recordValue){var k;"Array"===f.constructor.name?(a=f.indexOf(n),k=f.length):(a=n,k=f);0>a||a>k?console.warn("Ignoring metrics record for unknown value: "+n):(n={metricName:"Quickoffice.FileFormat",type:"histogram-linear",min:1,max:k,buckets:k+1},c.isDebug()&&void 0===window.__umaMock?console.log("UMA not supported in debug mode"):chrome.metricsPrivate.recordValue(n,a))}}},recordCount:function(e){e=e||{};var f=l+(e.dataPoint||
"");e=e.value||0;if(k.isString(name)&&k.isNumber(e)&&k.isList(a)){var v,h;k.isList(a)?(h=a.indexOf(f),v=a.length):(h=f,v=a);if(!(0<=h&&h<=v))console.warn("Ignoring unknown metrics record "+f+" with value: "+e);else if(!c.isDebug()&&chrome&&chrome.metricsPrivate&&chrome.metricsPrivate)switch(v="Quickoffice."+f,f){case "docPageCount":case "docxPageCount":chrome.metricsPrivate.recordValue&&chrome.metricsPrivate.recordValue({metricName:v,type:"histogram-log",min:1,max:1E3,buckets:50},e);break;case "docParagraphCount":case "docxParagraphCount":chrome.metricsPrivate.recordMediumCount&&
chrome.metricsPrivate.recordMediumCount(v,e);break;case "csvSheetCount":case "docSectionCount":case "docxSectionCount":case "xlsSheetCount":case "xlsxSheetCount":case "pptSlideCount":case "pptxSlideCount":case "pptMasterCount":case "pptxMasterCount":chrome.metricsPrivate.recordSmallCount&&chrome.metricsPrivate.recordSmallCount(v,e);break;case "csvNonEmptyCellCount":case "xlsNonEmptyCellCount":case "xlsxNonEmptyCellCount":case "csvFormattedCellCount":case "xlsFormattedCellCount":case "xlsxFormattedCellCount":chrome.metricsPrivate.recordCount&&
chrome.metricsPrivate.recordCount(v,e);break;default:console.warn("Record count ignored unknown metric "+v)}}else console.warn("Metrics cannot record count - invalid parameters")}}});
define("qowtRoot/errors/unique/scriptLoadingTimeout",["qowtRoot/errors/qowtException"],function(c){var k=function(){this.title="drive_open_timeout_error_short_msg";this.details="drive_open_timeout_error_msg";this.gaState="ScriptLoadingTimeout";c.apply(this,arguments);this.name="ScriptLoadingTimeout";Error.captureStackTrace(this,k)};k.prototype=Object.create(c.prototype);return k.prototype.constructor=k});
define("qowtRoot/utils/driveErrors",[],function(){return{OFFLINE:-1,AUTHENTICATION_TOKEN_NOT_ISSUED:400,INVALID_CREDENTIALS:401,FORBIDDEN:403,FILE_NOT_FOUND:404,INTERNAL_SERVER_ERROR:500,TIMEOUT:503}});
define("utils/gdrive/firstPartyAuth",["qowtRoot/third_party/when/when","qowtRoot/utils/driveErrors"],function(c,k){function l(){window[x]=void 0;window[v]=void 0;return c.resolve()}function f(){return a(n,p).then(function(){return a(n,h)}).then(function(){return a(n,y)}).then(function(){return Promise.reject({status:k.INVALID_CREDENTIALS})}).catch(function(a){return a?Promise.reject(a):Promise.resolve()})}function a(a,c){return new Promise(function(e,f){chrome.cookies.get({url:a,name:c},function(a){a&&
void 0!==a.value?(window[x]=a.value,f()):e()})})}function e(a,e,f,h){return c.promise(function(c,n){chrome.cookies.get({url:a,name:e},function(a){a&&void 0!==a.value?(window[f]=h?a.value:!!a.value,c()):n({status:k.INVALID_CREDENTIALS})})})}var n="https://*.google.com/",v="__OVERRIDE_SID",h="SAPISID",p="__Secure-1PAPISID",y="__Secure-3PAPISID",x="__SAPISID";return{setCookies:function(){return c.all([l(),f()])},setCookiesOlderWay:function(){return c.all([l(),e("http://*.google.com/","SID",v),e(n,h,
x,!0)])}}});define("qowtRoot/models/env",[],function(){return{pointsPerEm:12,fontUnit:"pt"}});
define("qowtRoot/utils/deprecatedUtils",["qowtRoot/models/env","qowtRoot/utils/typeUtils","qowtRoot/errors/qowtSilentError","qowtRoot/errors/errorCatcher"],function(c,k,l,f){var a={NodeType:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12,1:"ELEMENT_NODE",2:"ATTRIBUTE_NODE",3:"TEXT_NODE",4:"CDATA_SECTION_NODE",5:"ENTITY_REFERENCE_NODE",
6:"ENTITY_NODE",7:"PROCESSING_INSTRUCTION_NODE",8:"COMMENT_NODE",9:"DOCUMENT_NODE",10:"DOCUMENT_TYPE_NODE",11:"DOCUMENT_FRAGMENT_NODE",12:"NOTATION_NODE"},RegExp:{HEX:/^#?([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/gi,HEX3:/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/gi},regExpExec:function(a,c){var f;if(k.isRegex(a)&&k.isString(c)){var h=a.exec(c);h&&h.length&&(f=h);a.lastIndex=0}return f},parseBoolean:function(a){return"false"===a||"False"===a||!1===a||0===a?!1:!0},computePercentValueOf:function(a,c){return a*
c/100},stripNode:function(c){for(var f=a.cpArray(c.childNodes),k=c.parentNode,h=0;h<f.length;h++)Polymer.dom(k).insertBefore(f[h],c),Polymer.dom(k).flush();Polymer.dom(k).removeChild(c);Polymer.dom(k).flush()},cpArray:function(a){for(var c=[],f=0;f<a.length;f++)c[c.length]=a[f];return c},cloneAndAttach:function(c,f,k){k=a.cloneDiv(c,k);a.copyAllContainedCanvases(c,k);Polymer.dom(f).appendChild(k);Polymer.dom(f).flush();return k},cloneDiv:function(c,f){var k=c.cloneMe?c.cloneMe():c.cloneNode(!1);"qowt-point-para"===
k.is&&(k.className=k.className.replace(/[\s]qowt-point-para-[\d]+/,""));k.setEid&&k.setEid(c.getEid());for(var h=0;h<c.childNodes.length;h++){var l=c.childNodes[h];l.getAttribute&&"handlers"===l.getAttribute("qowt-divtype")||(l=a.cloneDiv(l),k.appendChild(l))}f&&(k.id=f);return k},copyAllContainedCanvases:function(c,f){for(var k=c.querySelectorAll("canvas"),h=f.querySelectorAll("canvas"),l=0;l<k.length;l++)if(void 0!==k[l]&&void 0!==h[l]){var y=k[l].getContext("2d"),x=h[l].getContext("2d");a.cloneCanvasImage(y,
x)}},cloneCanvasImage:function(a,c){if(0<a.canvas.width&&0<a.canvas.height){var k=a.getImageData(0,0,a.canvas.width,a.canvas.height);k?c.putImageData(k,0,0):(k=new l("Failed to execute putImageData on CanvasRenderingContext2D."),f.handleError(k))}},getElementStyleString:function(a){var c="",f;for(f in a)c+=f+":"+a[f]+";";return c},appendJSONAttributes:function(a,c){for(var f in c)a[f]=c[f]},bulletTextMeasureElement:void 0,setBulletTextMeasureElement:function(){a.bulletTextMeasureElement={};a.bulletTextMeasureElement._bulletTextMeasureElement=
document.createElement("P");a.bulletTextMeasureElement._bulletTextMeasureElement.className="bulletTextMeasureCss";a.bulletTextMeasureElement._bulletTextMeasureElement.style.position="absolute";a.bulletTextMeasureElement._bulletTextMeasureElement.style.visibility="hidden";a.bulletTextMeasureElement._bulletTextMeasureElement.height="auto";a.bulletTextMeasureElement._bulletTextMeasureElement.width="auto";a.bulletTextMeasureElement._bulletTextMeasureElement_Style=document.createElement("style");a.bulletTextMeasureElement._bulletTextMeasureElement_Style.type=
"text/css";document.getElementsByTagName("head")[0].appendChild(a.bulletTextMeasureElement._bulletTextMeasureElement_Style);c.rootNode.appendChild(a.bulletTextMeasureElement._bulletTextMeasureElement)},setNumberTextMeasureElement:function(){a.numberTextMeasureElement={};a.numberTextMeasureElement._numberTextMeasureElement=document.createElement("P");a.numberTextMeasureElement._numberTextMeasureElement.className="numberTextMeasureCss";a.numberTextMeasureElement._numberTextMeasureElement.style.position=
"absolute";a.numberTextMeasureElement._numberTextMeasureElement.style.visibility="hidden";a.numberTextMeasureElement._numberTextMeasureElement.height="auto";a.numberTextMeasureElement._numberTextMeasureElement.width="auto";a.numberTextMeasureElement._numberTextMeasureElement_Style=document.createElement("style");a.numberTextMeasureElement._numberTextMeasureElement_Style.type="text/css";document.getElementsByTagName("head")[0].appendChild(a.numberTextMeasureElement._numberTextMeasureElement_Style);
if(void 0===c.rootNodeContainer||null===c.rootNodeContainer)c.rootNodeContainer=document.getElementById("qowt-doc-root");c.rootNodeContainer.appendChild(a.numberTextMeasureElement._numberTextMeasureElement)},returnUndefinedIfEmptyJson:function(a){return _.isEmpty(a)?void 0:a}};return a});
define("qowtRoot/utils/domUtils",["qowtRoot/models/env","qowtRoot/utils/deprecatedUtils","qowtRoot/utils/typeUtils"],function(c,k,l){var f={totalHeight:function(a){return a.getBoundingClientRect().height},peerIndex:function(a){if(a){for(var c=0;a.previousElementSibling;)"TEMPLATE"!==a.previousElementSibling.nodeName&&c++,a=a.previousElementSibling;return c}},isEditable:function(a){a.nodeType===Node.TEXT_NODE&&(a=a.parentNode);return(a=window.getComputedStyle(a))?"read-write"===a["-webkit-user-modify"]:
!1},previousNode:function(a){for(var c=a?a.previousSibling:void 0;!c&&a&&a.parentNode;)a=a.parentNode,c=a.previousSibling;for(;c&&c.lastChild;)c=c.lastChild;return c},nextNode:function(a){for(var c=a?a.nextSibling:void 0;!c&&a&&a.parentNode;)a=a.parentNode,c=a.nextSibling;for(;c&&c.firstChild;)c=c.firstChild;return c},rightMostLeafNode:function(a){for(a=a&&"P"===a.nodeName?a&&a.lastElementChild:a&&Polymer.dom(a).lastChild;a&&Polymer.dom(a).lastChild;)a=Polymer.dom(a).lastChild,"span"===a.nodeName.toLowerCase()&&
a.lastChild&&(a=a.lastChild);return a},leftMostLeafNode:function(a){for(a=a&&"P"===a.nodeName?a&&a.firstElementChild:a&&Polymer.dom(a).firstChild;a&&Polymer.dom(a).firstChild;)a=Polymer.dom(a).firstChild,"span"===a.nodeName.toLowerCase()&&a.firstChild&&(a=a.firstChild);return a},getSiblingByIndex:function(a,c){for(;0<c;c--)if(a=Polymer.dom(a).nextSibling,!a)return null;return a},insertAtStart:function(a,e){"point"===c.app&&(0<e.children.length?e.insertBefore(a,e.children[0]):e.appendChild(a));"word"===
c.app&&("P"===e.nodeName?0<e.children.length?e.insertBefore(a,e.children[0]):e.appendChild(a):(0<Polymer.dom(e).children.length?Polymer.dom(e).insertBefore(a,Polymer.dom(e).children[0]):Polymer.dom(e).appendChild(a),Polymer.dom(e).flush()))},insertAtEnd:function(a,c){"P"===c.nodeName?c.appendChild(a):(Polymer.dom(c).appendChild(a),Polymer.dom(c).flush())},insertAfter:function(a,e){var f=Polymer.dom(e).parentNode;f&&("word"===c.app?"P"===f.nodeName?f.insertBefore(a,e.nextSibling):(Polymer.dom(f).insertBefore(a,
Polymer.dom(e).nextElementSibling),Polymer.dom(f).flush()):(a instanceof QowtPointRun&&(f=e.parentNode),f&&f.insertBefore(a,e.nextSibling)))},insertBefore:function(a,e){var f;if("word"===c.app){if(f=Polymer.dom(e).parentNode)"P"===f.nodeName?e.isQowtElement||1!==f.children.length?f.insertBefore(a,e):f.appendChild(a):(e.isQowtElement||1!==f.children.length?Polymer.dom(f).insertBefore(a,e):Polymer.dom(f).appendChild(a),Polymer.dom(f).flush())}else(f=e.parentNode)&&f.insertBefore(a,e)},insertAtSiblingOrParent:function(a,
c){if(!a)throw Error("insertAtSiblingOrParent missing context");if(!a.parentNodeId&&!a.siblingNodeId)throw Error("insertAtSiblingOrParent requires either parentNodeId or siblingNodeId");if(!a.parentNodeId)throw Error("insertAtSiblingOrParent missing parentNodeId");if(c&&!l.isFunction(c))throw Error("insertAtSiblingOrParent errorFuncton must be  a function");var k;(k=document.getElementById(a.siblingNodeId))?f.insertAfter(a.node,k):(k=document.getElementById(a.parentNodeId))?k.insertBefore(a.node,
Polymer.dom(k).children[0]):c&&l.isFunction(c)&&c(" failed to insert node - no parent or sibling node found!")},relativePosition:function(a){if(a.nodeType!==Node.TEXT_NODE)throw Error("error: relativePosition needs to be given text node");var c=0,f=0;for(a=Polymer.dom(a).previousSibling;a&&a.nodeType===Node.TEXT_NODE;)c+=a.textContent.length,a=a.previousSibling,f++;return{textNodeIndex:f,characterOffset:c}},absolutePos:function(a){var c=0,f=0;if(a.offsetParent){do c+=a.offsetTop,f+=a.offsetLeft,a=
a.offsetParent;while(null!==a)}return{top:c,left:f}},absoluteScroll:function(a){var c=0,f=0;if(a.offsetParent){do c+=a.scrollTop,f+=a.scrollLeft,a=a.offsetParent;while(null!==a)}return{top:c,left:f}},getById:function(a){if(1<arguments.length){for(var c=0,k=[],v=arguments.length;c<v;c++)k.push(f.getById(arguments[c]));return k}l.isString(a)&&(a=document.getElementById(a));return a},prependChildrenID:function(a,c,k){k=k||"-";if(a&&a.id&&(a.id=""+c+k+a.id,a.childNodes&&a.childNodes.length))for(var l=
0,h=a.childNodes.length;l<h;l++)f.prependChildrenID(a.childNodes[l],c,k)},insert:function(a,c,f){switch(f){case "replace":Polymer.dom(a).parentNode.replaceChild(c,a);Polymer.dom(a).flush();break;case "before":Polymer.dom(a).parentNode.insertBefore(c,a);Polymer.dom(a).flush();break;case "after":if(a===Polymer.dom(a).parentNode.childNodes[Polymer.dom(a).parentNode.childNodes.length-1])Polymer.dom(a).parentNode.appendChild(c);else{for(a=Polymer.dom(a).nextSibling;a&&a.nodeType!==k.NodeType.ELEMENT_NODE;)a=
Polymer.dom(a).nextSibling;Polymer.dom(a).parentNode.insertBefore(c,a)}Polymer.dom(a).flush();break;case "top":Polymer.dom(a).insertBefore(c,Polymer.dom(a).childNodes[0]);Polymer.dom(a).flush();break;default:Polymer.dom(a).appendChild(c),Polymer.dom(a).flush()}},stopEvent:function(a){a&&(a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation())},contains:function(a,c){return a?!!(a.compareDocumentPosition(c)&document.DOCUMENT_POSITION_CONTAINED_BY):!1},isElementInViewport:function(a){a=
a.getBoundingClientRect();return 0<=a.top&&0<=a.left&&a.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&a.right<=(window.innerWidth||document.documentElement.clientWidth)},removeNode:function(a){if(a&&l.isNode(a)){var c=Polymer.dom(a).parentNode;c&&l.isNode(c)&&(Polymer.dom(a).parentNode.removeChild(a),Polymer.dom(a).flush())}},getTransformValue:function(a,c){var f=a.style.webkitTransform;if(""!==f)for(var f=f.split(")"),k=0;k<f.length;k++){var h=f[k].split("(");if(h[0].trim()===
c)switch(c){case "scale":return k=h[1].split(","),f=k[0].trim(),k=k[1].trim(),{flipH:f,flipV:k};case "rotate":return h[1]}}return!1},cloneStyle:function(a,c){c&&a&&(a.style.cssText=c.style.cssText)},isField:function(a){a=a?a.getAttribute&&a.getAttribute("qowt-divtype"):"";return"qowt-field-datetime"===a||"qowt-field-numpages"===a||"qowt-field-pagenum"===a?!0:!1},getLastEditableNode:function(a){if(1===a.children.length&&(a.isEmpty()||a.children[0]instanceof QowtHyperlink))return a.children[0];a=a.childNodes;
for(var c=a.length-1;-1<c&&!(a[c]instanceof QowtWordRun&&!a[c].isEmpty()||a[c]instanceof HTMLBRElement||a[c]instanceof QowtHyperlink);)c--;return a[c]},cloneNode:function(a,e,f){var k;k=a.cloneMe?a.cloneMe(f):f?document.importNode(a,!1):a.cloneNode(!1);k.setEid&&k.setEid(a.getEid());if(e)for(var h=0;h<a.childNodes.length;h++){var l=this.cloneNode(a.childNodes[h],e,f),y;if(y="word"===c.app)y=k instanceof QowtDrawing&&(l instanceof QowtTextBox||l instanceof QowtWordImage)?!0:!1;y?Polymer.dom(k).appendChild(l):
k.appendChild(l)}"word"===c.app&&Polymer.dom(k).flush();return k}};return f});
define("utils/gdrive/apiaryLoader",["qowtRoot/third_party/when/when","qowtRoot/utils/domUtils","qowtRoot/utils/driveErrors"],function(c,k,l){function f(){k.removeNode(a);var c=document.createElement("script");c.id=a;c.src=e+"?onload="+n;document.getElementsByTagName("head")[0].appendChild(c)}var a="__apiary_script",e="https://apis.google.com/js/client.js",n="__apiaryLoaded";return{load:function(){return navigator.onLine?c.promise(function(a){window[n]=function(){window[n]=void 0;a()};f()}):c.reject({status:l.OFFLINE})}}});
define("utils/gdrive/driveUtils",[],function(){return{getErrorCode:function(c){return c&&c.result&&c.result.error&&c.result.error.code||c&&c.status},getErrorReason:function(c){return c&&c.result&&c.result.error&&c.result.error.errors&&c.result.error.errors[0]&&c.result.error.errors[0].reason},getErrorMessage:function(c){return c&&c.result&&c.result.error&&c.result.error.message||c&&c.statusText},isValidDriveId:function(c){return c&&/^[a-zA-Z0-9_-]+$/.test(c)}}});
define("utils/gdrive/drive","qowtRoot/errors/errorCatcher qowtRoot/errors/qowtSilentError qowtRoot/errors/unique/scriptLoadingTimeout qowtRoot/utils/driveErrors utils/gdrive/firstPartyAuth utils/gdrive/apiaryLoader utils/gdrive/driveUtils qowtRoot/third_party/when/when".split(" "),function(c,k,l,f,a,e,n,v){function h(){return ca?v.resolve():v.all([e.load(),a.setCookies()]).timeout(3E4,new l("apiary script loading timeout")).then(p).then(function(){ca=!0})}function p(){gapi.client.setApiKey("AIzaSyD-qQA49y2Lv7b0KJCQghmHKe0iMHFnIts");
gapi.config.update("googleapis.config/auth/useFirstPartyAuth",!0);F&&gapi.config.update("googleapis.config/fogId",F)}function y(a){return da?v.resolve(da):z({path:"/drive/v2/files/"+a,method:"GET",params:{updateViewedDate:!0,supportsTeamDrives:!0}},"Drive.getMetaData_").then(function(a){return da=a&&a.result}).catch(Q)}function x(a){return z({path:"/drive/v2/files/"+a+"?alt=media",method:"GET",params:{supportsTeamDrives:!0}},"Drive.download_").then(H).catch(Q)}function N(a,c,e){a={path:"/drive/v2/files/"+
a+"/copy",method:"POST",params:{convert:c,supportsTeamDrives:!0}};e.title&&(a.body={title:e.title});return z(a,"Drive.createFileFromDriveFile_")}function G(a,e,f){f&&f.mimeType||c.handleError(new k("Drive upload called with no mime type."));var h=v.defer(),n=new FileReader;n.readAsBinaryString(a);n.onload=function(){var a=f.mimeType,c=btoa(n.result),a="\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(f)+"\r\n---------314159265358979323846\r\nContent-Type: "+
a+"\r\nContent-Transfer-Encoding: base64\r\n\r\n"+c+"\r\n---------314159265358979323846--";e.headers={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};e.body=a;z(e,"Drive.upload_").then(h.resolve,h.reject)};return h.promise}function z(c,e){var f=v.defer();gapi.client.request(c).then(f.resolve,function(c,h){E(h)?v.all([a.setCookies()]).done(function(){gapi.client.request(c).then(f.resolve,function(h){E(h)?v.all([a.setCookiesOlderWay()]).done(function(){gapi.client.request(c).then(f.resolve,
r.bind(null,f,e))},function(a){f.reject(a)}):r(f,e,h)})},function(a){f.reject(a)}):A(h)?gapi.client.request(c).then(f.resolve,r.bind(null,f,e)):r(f,e,h)}.bind(null,c));return f.promise}function A(a){var c=n.getErrorCode(a);a=n.getErrorReason(a);return c===f.INTERNAL_SERVER_ERROR||c===f.TIMEOUT||c===f.FORBIDDEN&&("rateLimitExceeded"===a||"userRateLimitExceeded"===a)}function E(a){a=n.getErrorCode(a);return a===f.INVALID_CREDENTIALS||a===f.AUTHENTICATION_TOKEN_NOT_ISSUED}function r(a,e,f){e+=" error:";
var h=n.getErrorCode(f),l=n.getErrorMessage(f);console.error([e,h,l].join(" "));c.handleError(new k([e,h].join(" ")));a.reject(f)}function H(a){a=a.body;for(var c=a.length,e=new ArrayBuffer(c),e=new Uint8Array(e),f=0;f<c;f++)e[f]=a.charCodeAt(f);return new Blob([e])}function Q(a){throw a;}var ca=!1,da,F;return{getMetaData:function(a){return h().then(y.bind(null,a))},download:function(a){return h().then(x.bind(null,a))},upload:function(a,c,e){e={path:"/upload/drive/v2/files/"+a,method:"PUT",params:{newRevision:e?
"true":"false",uploadType:"multipart",alt:"json",supportsTeamDrives:!0}};return h().then(y.bind(null,a)).then(G.bind(null,c,e))},createFileFromDriveFile:function(a,c,e){return h().then(N.bind(null,a,c,e))},createFileFromNonDriveFile:function(a,c,e){c={path:"/upload/drive/v2/files/",method:"POST",params:{uploadType:"multipart",convert:c,supportsTeamDrives:!0}};return h().then(G.bind(null,a,c,e))},clearCachedMetaData:function(){da=void 0},setUserId:function(a){F=a}}});
define("qowtRoot/utils/pathUtils",["qowtRoot/utils/typeUtils"],function(c){return{create:function(k){return function(){var l={extension:function(){return a},dirName:function(){return n},baseName:function(){return e},fileName:function(){return f},smartBaseName:function(){var a=l.baseName();if(a)var c=/(-[0-9]+)$/g,e=a.match(c),a=e?a.replace(c,--e):a+"-1";return a}},f,a,e,n;(function(){if(k&&c.isString(k)){var l=k.lastIndexOf("/");n=-1!==l?k.substr(0,l+1):void 0;f=-1!==l?k.substr(l+1):k;l=f.lastIndexOf(".");
e=-1!==l?f.substr(0,l):f;var h=f.length;a=-1!==l?f.substr(l+1,h):void 0}})();return l}()}}});define("qowtRoot/utils/uuid",[],function(){return{generateUUID:function(){var c=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(k){var l=(c+16*Math.random())%16|0;c=Math.floor(c/16);return("x"===k?l:l&7|8).toString(16)})}}});
define("controllers/fileManager","qowtRoot/third_party/when/when utils/converter utils/xhr utils/pluginLoader utils/fileWriter utils/metrics utils/gdrive/drive utils/gdrive/driveUtils ui/progressSpinner controllers/appState qowtRoot/utils/i18n qowtRoot/utils/tryUtils qowtRoot/utils/pathUtils qowtRoot/errors/qowtException qowtRoot/errors/unique/httpErrorFileNotFound qowtRoot/errors/unique/httpErrorZero qowtRoot/errors/unique/timeoutError qowtRoot/errors/unique/scriptLoadingTimeout qowtRoot/utils/typeUtils qowtRoot/utils/driveErrors qowtRoot/utils/uuid third_party/lo-dash/lo-dash.min".split(" "),function(c,
k,l,f,a,e,n,v,h,p,y,x,N,G,z,A,E,r,H,Q,ca){var da,F=function(){};F.prototype={__proto__:Object.prototype,init:function(a,e){this.config_=a;this.uuid_=e;this.isReady=!1;this.fileTypeKnown=c.defer();var f=c(this.fileTypeKnown.promise).then(this.loadPlugin_.bind(this)).catch(function(a){throw a;}),h=c.resolve().then(this.tryToRestoreOrDeleteFromCache_.bind(this)).catch(this.openOriginalFile_.bind(this));return c.all([f,h]).then(this.whenDone_.bind(this))},getUUID:function(){return this.getCache().uuid},
updateConfigAndCache:function(a){a&&(this.config_.preferredFilename=this.config_.userFile.name,this.config_.userFile=void 0);this.config_.isDownloaded=!0;this.config_.isRenamed=a;this.cacheInfo_()},getCache:function(){var a=window.sessionStorage.getItem("__fileManagerCache");return x.ignore(JSON.parse.bind(JSON,a))||{}},getEntryPoint:function(){return da},originalURL:function(){return _.get(this,"config_.originalURL")},privateFilePath:function(){return this.returnFilePath_(_.get(this,"config_.privateFile",
{}))},downloadFilePath:function(){return this.returnFilePath_(_.get(this,"config_.downloadFile",{}))},userFilePath:function(){return this.returnFilePath_(_.get(this,"config_.userFile",{}))},mimeTypeFromFileName:function(a){return k.extension2Mime(k.name2ext(a))},mimeType:function(){var a=this.config_.mimeType;k.mime2App(a)||(a=this.userFilePath()||this.privateFilePath()||this.originalURL(),a=N.create(a).extension()||this.config_.extension,a=k.extension2Mime(a));return a},displayName:function(){var a=
_.get(this,"config_.preferredFilename",{});if(0<a.length)return a;var c;if(a=this.userFilePath()||this.originalURL()){a=N.create(a).fileName();try{c=window.decodeURIComponent(a)}catch(e){try{c=window.unescape(a)}catch(f){c=a}}}else c=this.config_.title;return c},driveDocId:function(){return _.get(this,"config_.driveDocId")},driveFileRole:function(){return _.get(this,"config_.driveFileRole")},isNewDocument:function(){return _.get(this,"config_.newDocument")},isEmbedded:function(){return _.get(this,
"config_.embedded")},createPrivateFile:function(a){this.config_.mimeType=k.extension2Mime(a);return this.createPrivateFile_(a).then(this.cacheInfo_.bind(this))},overwriteUserFile:function(a){return this.config_.privateFile?this.config_.driveDocId||this.config_.userFile?this.config_.driveDocId?this.uploadDriveFile_(a):this.copyFile_(this.config_.privateFile,this.config_.userFile):c.reject(Error("Cannot overwrite user file: No user or drive file")):c.reject(Error("Cannot overwrite user file: private is file missing"))},
newUserFile:function(a,e){function f(a){return n.createFileFromNonDriveFile(a,!1,k).catch(function(){return this.saveAsLocal_()}.bind(this))}var h,k;this.config_.privateFile?!this.config_.driveDocId||e?h=this.saveAsLocal_(a):a?(k={title:this.nameForCopiedFile_()},h=n.createFileFromDriveFile(this.config_.driveDocId,!1,k)):(k={title:this.nameForSaveAsFile_(),mimeType:this.mimeType(),parents:[_.get(this,"config_.parents[0]")]},h=this.getFileFromEntry_(this.config_.privateFile).then(f.bind(this))):h=
c.reject(Error("Cannot create new user file: Private file missing"));return h},downloadToLocalFile:function(){this.getFileFromEntry_(this.config_.downloadFile).then(function(a){a=new File([a],a.name,{type:this.mimeTypeFromFileName(a.name)});a=window.URL.createObjectURL(a);var c=this.tryAndGetDownloadFileName();chrome.downloads.download({url:a,filename:c,conflictAction:"uniquify",saveAs:!1})}.bind(this))},tryAndGetDownloadFileName:function(){var a=_.get(this,"config_.downloadFileName","downloadedFile"),
c="."+(this.config_.extension?this.config_.extension:k.mime2Extension(this.mimeType()));try{a=a.replace(/[<>:"/\\|?*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()}),/(\.do[ct][xm]?|\.p[po]t[xm]?|\.xl[st][xm]?|\.csv)$/i.exec(a)||(a+=c)}catch(e){a="downloadedFile"+c}return a},convertToDocs:function(){var a={title:this.nameForConvertedFile_(),mimeType:this.mimeType()};return this.config_.driveDocId?n.createFileFromDriveFile(this.config_.driveDocId,!0,a):this.getFileFromEntry_(this.config_.privateFile).then(function(c){return n.createFileFromNonDriveFile(c,
!0,a)})},cacheFileDetails:function(a){window.sessionStorage.setItem("__fileManagerCache",JSON.stringify(a))},returnFilePath_:function(a){return a.fullPath||a.name},getFileType_:function(){var a;this.config_.driveDocId?a="driveDoc":this.config_.streamURL?a="stream":this.config_.userFile?a="userFile":this.config_.newDocument&&(a="newdocument");return a},getDriveDoc_:function(){return n.getMetaData(this.config_.driveDocId).then(function(a){void 0===a.mimeType||void 0===a.title||void 0===a.id?a=void 0===
k.mime2App(a.mimeType)?c.reject(Error("Drive mimeType not an MS Office mimeType")):c.reject(Error("Drive document missing crucial information")):(this.config_.mimeType=a.mimeType,this.config_.extension=a.fileExtension,this.config_.title=a.title,this.config_.driveDocId=a.id,this.config_.parents=a.parents,this.config_.driveFileRole=_.get(a,"userPermission.role"),a=this.createPrivateFile_().then(this.updateInfoAndDownload_.bind(this,"DownloadingDriveDoc")));return a}.bind(this)).yield(!0)},getStream_:function(){return this.createPrivateFile_().then(this.updateInfoAndDownload_.bind(this,
"DownloadingStream")).yield(!0)},getUserFile_:function(){return this.createPrivateFile_().then(function(){this.updateAppStateAndCache_("LocalFile");return this.copyFile_(this.config_.userFile,this.config_.privateFile)}.bind(this))},getNewDocument_:function(a){"word"===a?(this.config_.mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document",this.config_.title="Untitled document.docx"):"point"===a?(this.config_.mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation",
this.config_.title="Untitled presentation.pptx"):"sheet"===a&&(this.config_.mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",this.config_.title="Untitled spreadsheet.xlsx");return this.createPrivateFile_().then(this.updateInfoAndLoadNewDocument_.bind(this,"LoadingNewDocument",a)).yield(!0)},updateInfoAndLoadNewDocument_:function(a,c){this.updateAppStateAndCache_(a);return this.loadNewDocument_(c)},getTemplateUrl_:function(a){if("word"===a)return"templates/blank.docx";if("point"===
a)return"templates/blank.pptx";if("sheet"===a)return"templates/blank.xlsx"},loadNewDocument_:function(c){h.show();var e=h.addContributor(.9);c=this.getTemplateUrl_(c);return(new l({baseUrl:chrome.runtime.getURL(c)})).send().then(function(c){return(new a(this.config_.privateFile)).writeData(c)}.bind(this),void 0,e).then(function(){this.config_.isDownloaded=!0;this.cacheInfo_();e(1);h.hide()}.bind(this))},updateInfoAndDownload_:function(a){this.updateAppStateAndCache_(a);return this.download_()},updateAppStateAndCache_:function(a){this.initAppState_(a);
this.cacheInfo_();this.fileTypeKnown.resolve()},restoreConfigFromCache_:function(a){this.config_.isDownloaded=a.isDownloaded;this.config_.isRenamed=a.isRenamed;this.config_.mimeType=a.mimeType||this.config_.mimeType;this.config_.extension=a.extension||this.config_.extension;this.config_.driveDocId=a.driveDocId||this.config_.driveDocId;this.config_.driveFileRole=a.driveFileRole||this.config_.driveFileRole;this.config_.newDocument=a.newDocument||this.config_.newDocument;this.config_.title=a.title||
this.config_.title;this.config_.parents=a.parents||this.config_.parents;this.config_.originalURL=a.originalURL||this.config_.originalURL},deleteFromCache_:function(a){return this.deletePrivateFile_(a).then(this.cacheFileDetails.bind(this,{}))},tryDeletingPrivateFile_:function(a){function e(){return c.reject(Error("IncompleteDownload"))}function f(){return c.reject(Error("CacheDeleteFailed"))}return a.privateFilePath?this.deleteFromCache_(a.privateFilePath).then(e,f):c.reject(Error("NoPrivateFile"))},
tryToRestoreOrDeleteFromCache_:function(){var a;(a=this.getCache())&&a.uuid===this.uuid_?a.isDownloaded?(da="restore",this.restoreConfigFromCache_(a),a=this.tryToRestoreFiles_(a)):a=this.tryDeletingPrivateFile_(a):a=c.reject(Error("NoCache"));return a},saveFileEntryAndUpdateCache_:function(a){this.config_.userFile=a;this.cacheInfo_()},tryToRestoreFiles_:function(a){function e(){this.config_.downloadFileName=a.downloadFileName;this.updateAppStateAndCache_("BrowserRefresh");return a.userFileId?this.restoreFileById_(a.userFileId).then(this.saveFileEntryAndUpdateCache_.bind(this)).yield(!0):
!0}return a.privateFilePath?this.restorePrivateFile_(a.privateFilePath).then(this.restoreDownloadFile_.bind(this,a.downloadFilePath)).then(e.bind(this)):c.reject(Error("There is no cached private file path"))},nameForCopiedFile_:function(){return"Copy of "+this.displayName()},nameForSaveAsFile_:function(){return"Copy of "+N.create(this.displayName()).baseName()+"."+k.mime2Extension(this.mimeType())},nameForConvertedFile_:function(){return N.create(this.displayName()).baseName()},saveAsLocal_:function(a){var e=
N.create(this.displayName()),f=this.config_.userFile&&!this.config_.isRenamed?e.smartBaseName():e.baseName(),h=k.mime2App(this.mimeType());a=a?[e.extension()]:ta[h];f+="."+(-1===a.indexOf(e.extension())?a[0]:e.extension());return this.selectFile_(f,a).then(function(a){this.config_.mimeType=void 0;this.config_.extension=void 0;this.config_.driveDocId=void 0;this.config_.driveFileRole=void 0;this.config_.preferredFilename=void 0;this.config_.newDocument=void 0;this.saveFileEntryAndUpdateCache_(a);return this.copyFile_(this.config_.privateFile,
this.config_.userFile)}.bind(this),function(){return c.reject({userCancelled:!0})})},initAppState_:function(a){var c=this.mimeType();if(c&&0!==c.length){var f=k.mime2Extension(c);e.recordFileType(f);p.setApp(k.mime2App(c),f);p.updateState(a)}else throw Error("Unknown mimeType; unable to know which app to load");},whenDone_:function(){this.isReady=!0;return c.resolve(!0)},handleDriveError_:function(a){switch(v.getErrorCode(a)){case Q.FILE_NOT_FOUND:this.throwFileNotFoundException_();break;case Q.INTERNAL_SERVER_ERROR:case Q.OFFLINE:this.throwTemporaryUnableToOpenException_(a);
break;default:this.handleGenericFileError_(a)}},throwTemporaryUnableToOpenException_:function(a){throw new G({title:"temporary_unable_to_open_error_short_msg",details:"temporary_unable_to_open_error_msg",message:H.isString(a)&&a||a.message||v.getErrorCode(a)});},handleGenericFileError_:function(a){if("SecurityError"===a.name)this.throwSecurityException_();else if(a instanceof E)this.throwTimeoutException_(a);else{if(a instanceof A)throw a;if(a instanceof z)throw a;if(a instanceof r)throw a;this.throwFileOpenCrashException_(a)}},
throwEntryPointException_:function(){throw new G({title:"entry_point_error_short_msg",details:"entry_point_error_msg"});},throwSecurityException_:function(){throw new G({title:"file_opened_in_incognito_mode_error_title",details:"file_opened_in_incognito_mode_error_details"});},throwTimeoutException_:function(a){a.title=y.getMessage("download_file_timeout_error_short_msg");a.details=y.getMessage("download_file_timeout_error_msg");throw a;},throwFileNotFoundException_:function(){throw new G({title:"file_not_found_error_short_msg",
details:"file_not_found_error_msg"});},throwFileOpenCrashException_:function(a){var c=new G({title:"file_open_crash_error_short_msg",details:"file_open_crash_error_msg",message:H.isString(a)&&a||a.message||v.getErrorCode(a)});c.stack=a.stack;throw c;},cacheInfo_:function(){var a={originalURL:this.config_.originalURL,isDownloaded:this.config_.isDownloaded,streamURL:this.config_.streamURL,mimeType:this.config_.mimeType,extension:this.config_.extension,privateFilePath:this.privateFilePath(),downloadFilePath:this.downloadFilePath(),
downloadFileName:this.config_.downloadFileName,userFileId:this.config_.userFile&&window.RequestFileSystem&&chrome.fileSystem.retainEntry(this.config_.userFile),driveDocId:this.config_.driveDocId,newdocument:this.config_.newdocument,driveFileRole:this.config_.driveFileRole,title:this.config_.title,parents:this.config_.parents,isRenamed:this.config_.isRenamed,uuid:this.uuid_};this.cacheFileDetails(a)},restoreFileById_:function(a){return c.promise(function(c,e){window.RequestFileSystem?chrome.fileSystem.restoreEntry(a,
c):e(Error("NoAccessToFileSystem"))})},restorePrivateFile_:function(a){return this.getTempFs_().then(function(c){return a?this.openFileAndSaveEntry_(c,a,"privateFile"):this.createPrivateFile_()}.bind(this))},createDownloadableFile_:function(){return this.getTempFs_().then(function(a){return this.createDownloadableFileFromPrivateFile_(a)}.bind(this)).then(function(a){this.config_.downloadFile=a;this.config_.downloadFileName=this.displayName()}.bind(this))},restoreDownloadFile_:function(a){return this.getTempFs_().then(function(c){return a?
this.openFileAndSaveEntry_(c,a,"downloadFile"):this.createDownloadableFile_()}.bind(this))},download_:function(){h.show();var e=h.addContributor(.9);return(this.config_.driveDocId?n.download(this.config_.driveDocId):void 0===this.config_.streamURL?c.reject(Error("FileManager needs URL to download")):(new l({baseUrl:this.config_.streamURL})).send()).then(function(c){return(new a(this.config_.privateFile)).writeData(c)}.bind(this),void 0,e).then(function(){this.config_.isDownloaded=!0;this.cacheInfo_();
e(1);h.hide()}.bind(this))},loadPlugin_:function(){var a=this.mimeType(),c=k.mime2App(a);if(!c||0===c.length)throw Error("Could not find app from mimeType: "+a);return(new f).loadPlugin(c)},selectFile_:function(a,e){return c.promise(function(c,f){window.chrome.fileSystem.chooseEntry({type:"saveFile",suggestedName:a,accepts:[{extensions:e}]},function(a){window.chrome.runtime.lastError&&"User cancelled"===window.chrome.runtime.lastError.message?f(Error(window.chrome.runtime.lastError.message)):window.chrome.fileSystem.getDisplayPath(a,
function(e){a.localFilePath=e;c(a)})}.bind(this))}.bind(this))},getTempFs_:function(){return c.promise(function(a,c){window.webkitRequestFileSystem(window.TEMPORARY,1048576,a,c)})},getFileFromFs_:function(a,e,f){return c.promise(function(c,h){a.root.getFile(e,f,c,h)})},createFile_:function(a,c){return this.getFileFromFs_(a,c,{create:!0,exclusive:!1})},openFile_:function(a,c){return this.getFileFromFs_(a,c,{create:!1})},createDownloadableFileFromPrivateFile_:function(a){return c.promise(function(c,
e){var f=this.config_.privateFile,h=f.name.split("."),h=[h[0],h[1]].join("_downloadable.");f.copyTo(a.root,h,c,e)}.bind(this))},deletePrivateFile_:function(a){return this.getTempFs_().then(function(e){return c.promise(function(c,f){e.root.getFile(a,{create:!1},function(a){a.remove(c,f)})})})},createPrivateFile_:function(a){return this.getTempFs_().then(function(a,c){var e=ca.generateUUID(),f=a||k.mime2Extension(this.mimeType()),e=[e,f].join(".");return this.createFile_(c,e)}.bind(this,a)).then(function(a){return this.config_.privateFile=
a}.bind(this))},openFileAndSaveEntry_:function(a,c,e){return this.openFile_(a,c).then(function(a){return this.config_[e]=a}.bind(this))},copyFile_:function(e,f){function h(e,f){var k=new a(e);return"File"===f.constructor.name?k.writeData(f):c.reject("Cannot copy file: Source is not a File")}return void 0===f?c.reject(Error("Cannot copy file: Missing destination file")):f.isFile?void 0===e?c.reject(Error("Cannot copy file: Missing source file")):e.file?this.getFileFromEntry_(e).then(h.bind(null,f)):
h(f,e):c.reject("Cannot copy file: Destination is not a FileEntry/ a File")},uploadDriveFile_:function(a){var c=this.config_.driveDocId;return this.getFileFromEntry_(this.config_.privateFile).then(function(e){return n.upload(c,e,a)})},getFileFromEntry_:function(a){return c.promise(function(c,e){a.file?a.file(c):e(Error("Entry missing file function"))})},getPrivateFileFromEntry:function(){return this.getFileFromEntry_(this.config_.privateFile)},openOriginalFile_:function(a){var c;switch(this.getFileType_()){case "driveDoc":v.isValidDriveId(this.config_.driveDocId_)?
c=this.getDriveDoc_().catch(this.handleDriveError_.bind(this)):this.throwFileNotFoundException_();break;case "stream":c=this.getStream_().catch(this.handleGenericFileError_.bind(this));break;case "userFile":c=this.getUserFile_().catch(this.handleGenericFileError_.bind(this));break;case "newdocument":c=this.getNewDocument_(this.config_.newDocument).catch(this.handleGenericFileError_.bind(this));break;default:this.throwEntryPointException_(a)}return c.then(this.createDownloadableFile_.bind(this)).then(this.cacheInfo_.bind(this))}};
var ta={word:["docx"],sheet:["xlsx"],point:["pptx"]};return new F});
define("qowtRoot/utils/errorUtils",[],function(){return{stripStack:function(c){var k="";if(c=c.stack?c.stack.split("\n"):void 0)for(var k=k+(c[0]+";"),l=1;l<c.length;l++){var f=c[l].match(/\s*at\s*(\S*)\s*(\S*):(\d+):(\d+)\)/);if(f){f.shift();var a=f[1].lastIndexOf("/");f[1]=-1!==a?f[1].substr(a+1):f[1];k+=f.join(":")+";"}}return k},errorInfo:function(c){var k;c&&(k=c.e,c.e_info&&c.e_info.category&&(k+="; Category: "+c.e_info.category));return k},errorCode:function(c){return c&&c.split(";",1)[0]},
category:function(c){a:{c=c.split(";");for(var k=1;k<c.length;k++){var l=c[k].split(":");if("Category"===l[0].trim()){c=l[1].trim();break a}}c=""}return c}}});
define("errorObservers/gaExceptionLogger",["qowtRoot/pubsub/pubsub","qowtRoot/utils/errorUtils","utils/analytics/googleAnalytics"],function(c,k,l){var f="idle";c.subscribe("qowt:init",function(){f="idle"});return function(a){if("idle"===f){var c={msg:k.stripStack(a)||a.message||a.name||"unknown error",fatal:a.fatal};console.log("GA logging as:",c);l.sendException(c);f=a.fatal?"fatal exception logged":f}}});define("errorObservers/hideUI",["ui/progressSpinner"],function(c){return function(){c.hide()}});
define("errorObservers/showQOWT",[],function(){return function(c){c.silent||(document.getElementById("sandbox").style.display="block")}});
define("utils/sendUserFeedback",["qowtRoot/errors/errorCatcher","qowtRoot/utils/errorUtils","controllers/fileManager"],function(c,k,l){var f=[];c.addObserver(function(a){var c=a.fatal?"FATAL: ":"NonFatal: ",c=c+(k.stripStack(a)||a.message||a.name||"unknown error");f.push(c)});return{openFeedbackUI:function(a){a={requestFeedback:!0,feedbackInfo:{description:a,categoryTag:"FromQuickoffice",pageUrl:l.originalURL(),systemInformation:[{key:"appID",value:chrome.runtime.id},{key:"appVersion",value:chrome.runtime.getManifest().version},
{key:"mimeType",value:l.mimeType()},{key:"exceptions",value:f.toString()}]}};chrome.runtime.sendMessage("gfdkimpbcpahaombhbimeihdjnejgicl",a,function(){})}}});
define("utils/backgroundPageUtils",["qowtRoot/utils/promiseUtils","qowtRoot/third_party/when/when"],function(c){function k(){var a=new Promise(function(a,c){chrome&&chrome.runtime&&chrome.runtime.getBackgroundPage?chrome.runtime.getBackgroundPage(a):c(Error("chrome.runtime.getBackgroundPage not available"))});return Promise.race([a,c.delayThenReject(f,Error("chrome.runtime.getBackgroundPage timed out"))])}function l(e){var f=new Promise(function(a){var c=function(e){e.isReady?a(e):window.setTimeout(c.bind(null,
e),10)};c(e)});return Promise.race([f,c.delayThenReject(a,Error("Background page timed out getting ready"))])}var f=1E4,a=1E4;return{getPage:function(){return k().then(l)}}});
define("utils/urlUtils",["qowtRoot/utils/typeUtils"],function(c){return{parseURL:function(k){if(!c.isString(k))throw Error("Invalid URI");var l=k.split("?");k=l[0];var l=1<l.length?l[1]:"",f=this.parseQueryString(l);return{baseURL:k,queryString:l,queryObject:f}},parseQueryString:function(k){if(!c.isString(k))throw Error("Invalid QueryString");var l;if(k){l={};k=k.split(/[&;]/g);for(var f=0;f<k.length;f++)if(k[f]){var a=k[f].split("="),e=decodeURIComponent(a[0]).toLowerCase(),a=1<a.length?decodeURIComponent(a[1]):
void 0;l[e]=a}}return l},stripQueryString:function(){var c=this.parseURL(window.location.href);window.history.replaceState({},"",c.baseURL)}}});
!function(c,k){function l(l,p,r){var y=[];p=1==p?{entropy:!0}:p||{};l=n(e(p.entropy?[l,h(c)]:null==l?v():l,3),y);var F=new f(y),y=function(){for(var a=F.g(N),c=z,e=0;a<A;)a=(a+e)*x,c*=x,e=F.g(1);for(;a>=E;)a/=2,c/=2,e>>>=1;return(a+e)/c};return y.int32=function(){return 0|F.g(4)},y.quick=function(){return F.g(4)/4294967296},y.double=y,n(h(F.S),c),(p.pass||r||function(c,e,f,h){return h&&(h.S&&a(h,F),c.state=function(){return a(F,{})}),f?(k[G]=c,e):c})(y,l,"global"in p?p.global:this==k,p.state)}function f(a){var c,
e=a.length,f=this,h=0,k=f.i=f.j=0,l=f.S=[];for(e||(a=[e++]);h<x;)l[h]=h++;for(h=0;h<x;h++)l[h]=l[k=r&k+a[h%e]+(c=l[h])],l[k]=c;(f.g=function(a){for(var c,e=0,h=f.i,k=f.j,l=f.S;a--;)c=l[h=r&h+1],e=e*x+l[r&(l[h]=l[k=r&k+c])+(l[k]=c)];return f.i=h,f.j=k,e})(x)}function a(a,c){return c.i=a.i,c.j=a.j,c.S=a.S.slice(),c}function e(a,c){var f,h=[],k=typeof a;if(c&&"object"==k)for(f in a)try{h.push(e(a[f],c-1))}catch(l){}return h.length?h:"string"==k?a:a+"\x00"}function n(a,c){for(var e,f=a+"",k=0;k<f.length;)c[r&
k]=r&(e^=19*c[r&k])+f.charCodeAt(k++);return h(c)}function v(){try{var a;return p&&(a=p.randomBytes)?a=a(x):(a=new Uint8Array(x),(y.crypto||y.msCrypto).getRandomValues(a)),h(a)}catch(e){return a=y.navigator,[+new Date,y,a&&a.plugins,y.screen,h(c)]}}function h(a){return String.fromCharCode.apply(0,a)}var p,y=this,x=256,N=6,G="random",z=k.pow(x,N),A=k.pow(2,52),E=2*A,r=x-1;if(k["seed"+G]=l,n(k.random(),c),"object"==typeof module&&module.exports){module.exports=l;try{p=require("crypto")}catch(H){}}else"function"==
typeof define&&define.amd&&define("third_party/seedrandom/seedrandom.min",[],function(){return l})}([],Math);define("utils/timeUtils",[],function(){return{DAY_IN_MS:864E5,WEEK_IN_MS:6048E5,weekSinceEpoch:function(){var c=Date.now()/this.WEEK_IN_MS;return Math.ceil(c)}}});
define("common/elements/google-consumer-survey/google-consumer-survey",["qowtRoot/utils/localStorageManager","qowtRoot/utils/uuid","third_party/seedrandom/seedrandom.min","utils/timeUtils"],function(c,k,l,f){var a=90*f.DAY_IN_MS;window.GoogleConsumerSurvey=Polymer({is:"google-consumer-survey",properties:{siteId:{reflect:!1,value:""},targetPercentage:{reflect:!1,value:void 0},bucketing:{reflect:!1,value:void 0}},created:function(){this.UUID=c.getItem("__GCS_uuid")||k.generateUUID();c.setItem("__GCS_uuid",
this.UUID);window._402=window._402||{};window._402.promptHandlerUrl="https://www.google.com/insights/consumersurveys/gk/prompt"},attached:function(){this.shouldLaunchSurvey_()&&this.launchSurvey_()},shouldLaunchSurvey_:function(){var c=!1;this.targetPercentage||this.bucketing?this.surveyResultsStale_(f.WEEK_IN_MS)&&(c=this.sampleUser_()):c=this.surveyResultsStale_(a);return c},sampleUser_:function(){var a=!1,c=parseInt(this.UUID.split("-")[1],16),k=this.bucketing?65535/this.bucketing:65535,h=f.weekSinceEpoch(),
p=h%(this.bucketing||1)*k;c>=p&&c<p+k&&(this.fire("user-considered-for-sampling"),l(c*h)()<(void 0===this.targetPercentage?1:this.targetPercentage/100)&&(this.fire("user-sampled-for-survey"),a=!0));return a},surveyResultsStale_:function(a){var f=!0,k=c.getItem("__GCS_site_"+this.siteId);k&&(f=Date.now()-k>a);return f},launchSurvey_:function(){this.siteId&&0!==this.siteId.length&&this.parentNode?(this.scriptTag=document.createElement("script"),this.scriptTag.src="https://www.google.com/insights/consumersurveys/async_survey?force_http=1&site="+
this.siteId,this.appendChild(this.scriptTag),this.userSurveyed=!0,c.setItem("__GCS_site_"+this.siteId,Date.now())):console.warn("<google-consumer-survey>: missing siteId!")}});return{}});
define("monkeyLoader",["qowtRoot/features/utils"],function(c){function k(c,a,e){a([c],function(a){l++;e(a)},function(a){0===l?(console.warn("Failed to load "+c+". The monkey server is likely not running."),e()):(console.error("Monkey _is_ running, but we failed to laod module "+c+"."),console.error(a),console.error(a.stack))})}var l=0;return{load:function(f,a,e){a=a||"";c.isDebug()?(console.log("Loading "+f),k.apply(this,arguments)):e()}}});
define("controllers/application","qowtRoot/errors/errorCatcher qowtRoot/errors/qowtException qowtRoot/errors/unique/fileDoesNotExistError qowtRoot/utils/typeUtils qowtRoot/utils/tryUtils qowtRoot/utils/promiseUtils qowtRoot/messageBus/messageBus qowtRoot/features/utils controllers/appState controllers/fileManager errorObservers/gaExceptionLogger errorObservers/hideUI errorObservers/showQOWT utils/analytics/googleAnalytics utils/converter utils/metrics utils/sendUserFeedback utils/backgroundPageUtils utils/gdrive/driveUtils utils/urlUtils qowtRoot/third_party/when/when utils/gdrive/drive qowtRoot/utils/uuid qowtRoot/pubsub/pubsub qowtRoot/utils/localStorageManager common/elements/google-consumer-survey/google-consumer-survey".split(" "),function(c,
k,l,f,a,e,n,v,h,p,y,x,N,G,z,A,E,r,H,Q,ca,da,F,ta,t){function U(){Nb.app=z.mime2App(p.mimeType());var a=z.mime2Extension(p.mimeType()),c=!("docm"!==a&&"pptm"!==a&&"xlsm"!==a);p.getPrivateFileFromEntry().then(function(e){n.pushMessage({id:"openFile",displayName:p.displayName(),originalURL:p.originalURL(),userFileType:ua(),entryPoint:p.getEntryPoint(),driveFileReadOnly:"reader"===p.driveFileRole(),format:z.mime2Format(p.mimeType()),isRenamed:p.getCache().isRenamed,environment:Nb,isMacroEnabledFile:c,
newDocument:p.isNewDocument(),embedded:p.isEmbedded(),isIncognito:Ob,extension:a,fileSize:e.size})})}function S(c){c=c.data;if(!f.isString(c)&&!f.isObject(c))throw Error("Invlid content from Core");if(f.isString(c))c=a.withWarning("JSON Syntax error in content from Core").rethrow(JSON.parse.bind(JSON,c)),"NaClCrash"===c.name&&(va=!0);else if(va){var e=c;console.error("reporting minidump to local server");var h=new FormData;h.append("prod","Quickoffice");h.append("ver",chrome.runtime.getManifest().version);
h.append("upload_file_minidump",new Blob([e]));e=new XMLHttpRequest;e.open("POST",chrome.runtime.getManifest().crash_dump_server,!0);e.send(h);ta.publish("app:naclCrash")}va||n.pushMessage({id:"dcp",content:c})}function J(a){if(a.keyCode&&(a.metaKey||a.ctrlKey))switch(a.keyCode){case 80:a.preventDefault();n.pushMessage({id:"print"});break;case 83:a.preventDefault()}}function cc(){ed();wb({category:"network-status",action:window.navigator.onLine?"online":"offline"});return ca.promise(function(a){chrome.identity.getProfileUserInfo(function(c){c=
""!==c.email;var e=window.navigator.onLine;wb({category:"account-status",action:c?"signed-in":"signed-out"});wb({category:"account-network",action:c?e?"signedin-online":"signedin-offline":e?"signedout-online":"signedout-offline"});a()}.bind(this))}.bind(this)).timeout(3E3,"Timed-out waiting for identity info").catch(function(){})}function wb(a){if(window.navigator.onLine)G.sendEvent(a);else{var c=dc();c.push(a);t.setItem("pending_ga",JSON.stringify(c))}}function ed(){if(window.navigator.onLine){var a=
dc();if(0<a.length)for(var c=0;c<a.length;c++)a[c]&&"object"===typeof a[c]&&G.sendEvent({category:a[c].category,action:a[c].action,label:a[c].label});t.setItem("pending_ga",JSON.stringify([]))}}function dc(){var a;try{a=t.getItem("pending_ga"),a=JSON.parse(a),Array.isArray(a)||(a=[])}catch(c){a=[],console.warn("Failed to initialize file store so resetting it to be empty: "+c)}return a}function Lb(){return new Promise(function(a,c){chrome&&chrome.tabs&&chrome.tabs.get?chrome.tabs.get(Y,function(e){e?
(Ob=e.incognito,a()):c(Error("Missing tab for tabId "+Y))}):c(Error("Missing chrome.tabs API"))})}function $a(){var a=ca.defer();xb().then(function(c){Y=c.tabId;a.resolve()},function(){chrome&&chrome.tabs&&chrome.tabs.getCurrent?chrome.tabs.getCurrent(function(c){c&&c.id?(Y=c.id,a.resolve()):a.reject(Error("Missing tab id"))}):a.reject(Error("Missing chrome.tabs API"))});return Promise.race([a.promise,e.delayThenReject(3E4,Error("Requesting current tab id timed out"))])}function Ca(){n.listen(jb,
ea);n.listen(lb,yb);return Promise.resolve()}function xb(){null===I&&(I=new Promise(function(a,c){chrome.mimeHandlerPrivate.getStreamInfo(function(e){chrome.runtime.lastError?c(chrome.runtime.lastError):a(e)})}));return I}function ec(){return Promise.all([xb(),r.getPage()]).then(function(a){var c=p.getCache(),e=a[0];if(c&&c.originalURL===e.originalUrl)throw chrome.mimeHandlerPrivate.abortStream(),Error("Load from cache");return a[1].registerMimeHandlerStream(a[0])}).catch(function(){var a=Q.parseURL(window.location.href);
a.queryObject?(p.cacheFileDetails(a.queryObject),Q.stripQueryString()):a.queryObject=p.getCache();if(a.queryObject.state)return Da(a.queryObject.state);if(a.queryObject.uuid)return a.queryObject.uuid;throw new l;})}function Da(a){return r.getPage().then(function(c){var e;try{var f=JSON.parse(a);if(c.handleDriveDoc&&f.ids)e=c.handleDriveDoc(f.ids),da.setUserId(f.userId);else throw new k("Missing handleDriveDoc api");}catch(h){throw new k({title:"something_not_right",details:"file_not_found_error_msg"});
}return e||ca.reject(Error("Failed to retrieve the UUID for first Drive Doc"))})}function Mb(a){return r.getPage().then(function(c){if(c.addReaperLock){la=a[1];if(!f.isString(la))throw Error("Failed to get a valid UUID");c.addReaperLock(Y);c=c.getFileDetails(la);if(!c)throw new k("Missing FileDetails object");c=Object.create(c);return p.init(c,la)}throw Error("Background page's 'addReaperLock' function is undefined");}).then(hd)}function ea(a){var c=!1;a&&a.data&&"dcpRequest"===a.data.id&&(c=!0);
return c}function yb(a){return!ea(a)}function ab(){var a=t.getItem("onboardingComplete");chrome.i18n.getMessage("@@ui_locale").match(/en[-_]us/i)&&a&&!v.isDebug()&&v.isEnabled("hats")&&window.setTimeout(function(){var a={word:{siteId:"wtkwz5qvgh3olklj43wihw3lhi",rate:3},sheet:{siteId:"renjicjirwkihjol6bv5k5q7hm",rate:8},point:{siteId:"4jgyc2mhqmpdwpatxatmggghiq",rate:4}},c=z.mime2App(p.mimeType());if(a[c]){var e=q();e.siteId=a[c].siteId;e.targetPercentage=a[c].rate;e.bucketing=12;document.body.appendChild(e)}},
3E3)}function q(){var a=document.createElement("google-consumer-survey");a.addEventListener("user-considered-for-sampling",function(){G.sendEvent({category:"user-survey",action:"sampling",label:"user-consired"})});a.addEventListener("user-sampled-for-survey",function(){G.sendEvent({category:"user-survey",action:"sampling",label:"user-sampled"})});return a}function jb(a){if(a&&a.data&&a.data.content)if(a=a.data.content,-1!=="writeToExisting writeToNew writeToExistingDriveFile convertToDocs makeACopy download".split(" ").indexOf(a.name))Dc(a);
else{var c=Jc;switch(a.name){case "oPT":case "oDC":case "owb":a.pa=p.privateFilePath();c(a);break;case "sDC":"OOXML"===z.mime2Format(p.mimeType())?c(a):p.createPrivateFile("docx").done(Cc.bind(ba,a,c));break;case "saveWkbk":"OOXML"===z.mime2Format(p.mimeType())?zb(a,c):p.createPrivateFile("xlsx").done(zb.bind(ba,a,c));break;case "sPT":"OOXML"===z.mime2Format(p.mimeType())?zb(a,c):p.createPrivateFile("pptx").done(zb.bind(ba,a,c));break;default:c(a)}}else throw Error("DCP Requests must have content");
}function Cc(a,c){a.name="saveAs";a.dst=p.privateFilePath();c(a)}function zb(a,c){a.dst=p.privateFilePath();c(a)}function Dc(a){switch(a.name){case "writeToExisting":p.overwriteUserFile().done(Ab.bind(ba,a.name,p.userFilePath()),T.bind(ba,a.name));break;case "writeToNew":p.newUserFile(!1,a.context&&a.context.toLocal).then(Ab.bind(ba,a.name,p.userFilePath()),Ec.bind(ba,a.name)).done(function(){},T.bind(ba,a.name));break;case "makeACopy":T(a.name);p.newUserFile(!0).done(La.bind(ba,p.userFilePath()),
Ic);break;case "writeToExistingDriveFile":T(a.name);p.overwriteUserFile(a.newRevision).done(Fc.bind(ba,a.token),Gc.bind(ba,a.token));break;case "convertToDocs":T(a.name);p.convertToDocs().done(Hc,gd);break;case "download":Pb&&(chrome.downloads.onDeterminingFilename.addListener(function ia(a,c){c({filename:p.tryAndGetDownloadFileName(),conflictAction:"uniquify"});chrome.downloads.onDeterminingFilename.removeListener(ia);Pb=!0}),Pb=!1,p.downloadToLocalFile());T(a.name);break;default:console.log("#!#! Unexpected processAppRequest "+
a.name)}}function fc(a){return ca.promise(function(c){hc(kb(a),c)})}function gc(a){return ca.promise(function(c){var e=kb(a);chrome&&chrome.tabs&&e&&chrome.tabs.update(Y,{url:e},c)})}function kb(a){var c,e=a.result?a.result.alternateLink:void 0;if(e&&!e.match(/.*\/file\/.*/))c=e,c=(a=c.match(/(.*)\?(.*)/))?a[2]&&0<a[2].length?c+"&nativeconvert=1":c+"nativeconvert=1":c+"?nativeconvert=1";else if(!e||e.match(/.*\/file\/.*/))c="chrome-extension://"+chrome.runtime.id+'/views/app.html?state={"ids":["'+
a.result.id+'"],"action":"open"}';return c}function Ab(a,c,e){p.userFilePath()!==c&&V();"writeToNew"===a&&"drive"===ua()?gc(e).then(T.bind(ba,a)):T(a);n.pushMessage({id:"userFileNotification",context:{type:"saveSuccess",format:z.mime2Format(p.mimeType()),userFileType:ua(),isRenamed:void 0,localFilePath:"local"===ua()?e.localFilePath:"",driveFileReadOnly:"reader"===p.driveFileRole()}})}function Ec(a){n.pushMessage({id:"dcp",content:{name:a,userCancelled:!0,format:z.mime2Format(p.mimeType()),userFileType:ua(),
driveFileReadOnly:"reader"===p.driveFileRole()}});n.pushMessage({id:"userFileNotification",context:{type:"saveCancel"}})}function Fc(a){n.pushMessage({id:"driveFileNotification",context:{type:"saveSuccess",saveToken:a}})}function Gc(a,c){n.pushMessage({id:"driveFileNotification",context:{type:"saveFailure",saveToken:a,errorCode:H.getErrorCode(c)}})}function Hc(a){var c=nb;n.pushMessage({id:"driveFileNotification",context:{type:"convertSuccess"}});nb=!1;if(!c)return fc(a)}function gd(a){var c=nb;nb=
!1;c||n.pushMessage({id:"recordEvent",category:"menu",action:"convertToDocsFailed"});n.pushMessage({id:"driveFileNotification",context:{type:"convertFailure",errorCode:H.getErrorCode(a)}})}function La(a,c){"drive"===ua()?fc(c):(document.title=p.displayName(),p.userFilePath()!==a&&V(),n.pushMessage({id:"localFileNotification",context:{type:"copySuccess",displayName:p.displayName(),format:z.mime2Format(p.mimeType()),userFileType:ua(),driveFileReadOnly:!1}}))}function Ic(a){"drive"===ua()&&(n.pushMessage({id:"recordEvent",
category:"menu",action:"makeCopyFailed"}),n.pushMessage({id:"driveFileNotification",context:{type:"copyFailure",errorCode:H.getErrorCode(a)}}))}function T(a,c){document.title=p.displayName();n.pushMessage({id:"dcp",content:{name:a,displayName:p.displayName(),format:z.mime2Format(p.mimeType()),userFileType:ua(),driveFileReadOnly:"reader"===p.driveFileRole(),e:c&&c.message||c}})}function Jc(c){if(Ea&&Ea.postMessage)c=c instanceof ArrayBuffer?c:a.withWarning("Msg to Core must be JSON").rethrow(JSON.stringify.bind(JSON,
c)),Ea.postMessage(c);else throw Error("Error: NaCl module not ready?");}function ua(){var a;p.userFilePath()?a="local":p.driveDocId()&&(a="drive");return a}function lb(a){if(a&&a.data)switch(a.data.id){case "closeApp":window.close();break;case "reportAnIssue":E.openFeedbackUI(a.data.description);break;case "showHelp":case "signIntoDrive":hc(a.data.link);break;case "recordCount":A.recordCount(a.data.context);break;case "stateChange":a=a.data.data;h.updateState(a.state,a.context);break;case "recordEvent":G.sendEvent(a.data);
break;case "recordCachableEvent":wb(a.data);break;case "createNewTab":hc(a.data.link);break;case "conversionCancelled":nb=!0;break;case "reloadTab":if(Y&&chrome&&chrome.tabs){chrome.tabs.reload(Y);break}window.location.reload();break;case "setBlockUnload":chrome.mimeHandlerPrivate&&chrome.mimeHandlerPrivate.setShowBeforeUnloadDialog&&chrome.mimeHandlerPrivate.setShowBeforeUnloadDialog(!!a.data.blockUnload);break;case "fileNotFound":p.updateConfigAndCache(!0);break;case "fileSaveSuccess":p.updateConfigAndCache(),
n.pushMessage({id:"updateFileInfo"})}}function hc(a,c){chrome&&chrome.tabs&&a&&a.match(/^https?:\/\/|^file:\/\/|^mailto:/i)&&chrome.tabs.create({url:a},c)}function hd(){aa();mb();V();id();bb();Ma();Lb().then(function(){ba.openFile()}).catch(function(){Ob=!1;ba.openFile()})}function aa(){p.getPrivateFileFromEntry().then(function(a){G.sendEvent({id:"recordEvent",category:"raw-data",action:"ViewingFullContent",label:"fileSize_bytes",value:a.size});G.sendEvent({id:"recordEvent",category:"raw-data",action:"file-ready",
label:z.mime2Extension(p.mimeType())})})}function mb(){return r.getPage().then(function(a){if(a.cacheTabId)a.cacheTabId(la,Y);else throw Error("Background page's 'cacheTabId' function is undefined");})}function V(){return r.getPage().then(function(a){if(a.cachePrivateFilePath)a.cachePrivateFilePath(la,p.privateFilePath());else throw Error("Background page's 'cachePrivateFilePath' function is undefined");})}function id(){return r.getPage().then(function(a){if(a.cacheDownloadFilePath)a.cacheDownloadFilePath(la,
p.downloadFilePath());else throw Error("Background page's 'cacheDownloadFilePath' function is undefined");})}function bb(){return r.getPage().then(function(a){if(a.cacheTimestamp)a.cacheTimestamp(la);else throw Error("Background page's 'cacheTimestamp' function is undefined");})}function Ma(){return r.getPage().then(function(a){if(a.removeReaperLock)a.removeReaperLock(Y);else throw Error("Background page's 'removeReaperLock' function is undefined");})}var ba={openFile:function(){if(!p.isReady)throw Error("Error: app not ready to open file yet");
h.updateState("Opening");document.title=p.displayName();var a=z.mime2Icon(p.mimeType());if(a){var c=document.createElement("link");c.type="image/x-icon";c.rel="shortcut icon";c.href=a;document.getElementsByTagName("head")[0].appendChild(c)}if(Ea=document.getElementById("qonacl"))Ea.addEventListener("message",S,!1);else throw Error("App can not find core plugin");Na&&n.pushMessage({id:O,overrides:Na});U()}},qa,Nb,Ea,va,Na,O="featureOverrides",Y,la,Ob=!1,nb=!1,Pb=!0,I=null;(function(){chrome.runtime.onMessage.addListener(function(a,
c,e){"reaperCheck"===a&&e({uuid:p.getUUID()})})})();(function(){try{Na={};var a=window.sessionStorage.getItem(O),c=t.getItem(O);c||(c='{"edit":true,"pointEdit":true}');f.extend(Na,JSON.parse(a));f.extend(Na,JSON.parse(c));0<Object.keys(Na).length&&v.setOverrides(Na)}catch(e){}})();require(["monkeyLoader!monkeyAppClient"],function(){document.title="";qa=document.getElementById("sandbox");window.connectFromAppToQowt=new Date;n.connect(qa.contentWindow);var a=F.generateUUID();G.setSessionGroup(a);h.init();
Nb={locale:chrome.i18n.getMessage("@@ui_locale"),defaultLocale:"en"};window.addEventListener("keydown",J);c.addObserver(y);c.addObserver(x);c.addObserver(N);c.init();ca.all([cc(),ec(),$a(),Ca()]).then(Mb).then(ab).done()});return ba});require(["third_party/domready/domReady!"],function(){require(["controllers/application"])});define("mainApp",function(){});
